128 {
return ! ( lhs == rhs ); }
155 #define DEF_BUILTIN(A) static inline const IdString & _##A () { static IdString __str(#A); return __str; }
222 typedef Arch::CompatEntry CompatEntry;
225 typedef std::tr1::unordered_set<CompatEntry> Set;
226 typedef Set::iterator iterator;
227 typedef Set::const_iterator const_iterator;
230 static ArchCompatSet & instance()
232 static ArchCompatSet _instance;
239 const Arch::CompatEntry & assertDef(
const std::string & archStr_r )
240 {
return *
_compatSet.insert( Arch::CompatEntry( archStr_r ) ).first; }
242 const Arch::CompatEntry & assertDef( IdString archStr_r )
243 {
return *
_compatSet.insert( Arch::CompatEntry( archStr_r ) ).first; }
245 const_iterator begin()
const
248 const_iterator end()
const
253 int operator()(
const CompatEntry & lhs,
const CompatEntry & rhs )
const
254 {
return lhs._idBit.value() < rhs._idBit.value(); }
257 std::ostream &
dumpOn( std::ostream & str )
const
259 str <<
"ArchCompatSet:";
261 ov.sort( DumpOnCompare() );
262 for_( it, ov.begin(), ov.end() )
264 str << endl <<
' ' << *it;
276 _compatSet.insert( Arch::CompatEntry( _noarch(), 0 ) );
283 defCompatibleWith( _i386(), _noarch() );
284 defCompatibleWith( _i486(), _noarch(),_i386() );
285 defCompatibleWith( _i586(), _noarch(),_i386(),_i486() );
286 defCompatibleWith( _i686(), _noarch(),_i386(),_i486(),_i586() );
287 defCompatibleWith( _athlon(), _noarch(),_i386(),_i486(),_i586(),_i686() );
288 defCompatibleWith( _x86_64(), _noarch(),_i386(),_i486(),_i586(),_i686(),_athlon() );
290 defCompatibleWith( _pentium3(), _noarch(),_i386(),_i486(),_i586(),_i686() );
291 defCompatibleWith( _pentium4(), _noarch(),_i386(),_i486(),_i586(),_i686(),_pentium3() );
293 defCompatibleWith( _ia64(), _noarch(),_i386(),_i486(),_i586(),_i686() );
295 defCompatibleWith( _s390(), _noarch() );
296 defCompatibleWith( _s390x(), _noarch(),_s390() );
298 defCompatibleWith( _ppc(), _noarch() );
299 defCompatibleWith( _ppc64(), _noarch(),_ppc() );
301 defCompatibleWith( _alpha(), _noarch() );
302 defCompatibleWith( _alphaev5(), _noarch(),_alpha() );
303 defCompatibleWith( _alphaev56(), _noarch(),_alpha(),_alphaev5() );
304 defCompatibleWith( _alphapca56(), _noarch(),_alpha(),_alphaev5(),_alphaev56() );
305 defCompatibleWith( _alphaev6(), _noarch(),_alpha(),_alphaev5(),_alphaev56(),_alphapca56() );
306 defCompatibleWith( _alphaev67(), _noarch(),_alpha(),_alphaev5(),_alphaev56(),_alphapca56(),_alphaev6() );
308 defCompatibleWith( _sparc(), _noarch() );
309 defCompatibleWith( _sparcv8(), _noarch(),_sparc() );
310 defCompatibleWith( _sparcv9(), _noarch(),_sparc(),_sparcv8() );
311 defCompatibleWith( _sparcv9v(), _noarch(),_sparc(),_sparcv8(),_sparcv9() );
313 defCompatibleWith( _sparc64(), _noarch(),_sparc(),_sparcv8(),_sparcv9() );
314 defCompatibleWith( _sparc64v(), _noarch(),_sparc(),_sparcv8(),_sparcv9(),_sparcv9v(),_sparc64() );
316 defCompatibleWith( _armv3l(), _noarch() );
317 defCompatibleWith( _armv4l(), _noarch(),_armv3l() );
318 defCompatibleWith( _armv4tl(), _noarch(),_armv3l(),_armv4l() );
319 defCompatibleWith( _armv5l(), _noarch(),_armv3l(),_armv4l(),_armv4tl() );
320 defCompatibleWith( _armv5tel(), _noarch(),_armv3l(),_armv4l(),_armv4tl(),_armv5l() );
321 defCompatibleWith( _armv5tejl(), _noarch(),_armv3l(),_armv4l(),_armv4tl(),_armv5l(),_armv5tel() );
322 defCompatibleWith( _armv6l(), _noarch(),_armv3l(),_armv4l(),_armv4tl(),_armv5l(),_armv5tel(),_armv5tejl() );
323 defCompatibleWith( _armv7l(), _noarch(),_armv3l(),_armv4l(),_armv4tl(),_armv5l(),_armv5tel(),_armv5tejl(),_armv6l() );
324 defCompatibleWith( _armv7hl(), _noarch() );
325 defCompatibleWith( _armv7nhl(), _noarch(),_armv7hl() );
326 defCompatibleWith( _armv7thl(), _noarch(),_armv7hl() );
327 defCompatibleWith( _armv7tnhl(), _noarch(),_armv7hl(),_armv7nhl(),_armv7thl() );
329 defCompatibleWith( _sh3(), _noarch() );
331 defCompatibleWith( _sh4(), _noarch() );
332 defCompatibleWith( _sh4a(), _noarch(),_sh4() );
350 ZYPP_THROW( Exception(
"Need more bits to encode architectures.") );
359 const CompatEntry & assertCompatSetEntry( IdString archStr_r )
360 {
return *
_compatSet.insert( Arch::CompatEntry( archStr_r, nextIdBit() ) ).first; }
364 void defCompatibleWith( IdString targetArch_r,
366 IdString arch1_r = IdString(),
367 IdString arch2_r = IdString(),
368 IdString arch3_r = IdString(),
369 IdString arch4_r = IdString(),
370 IdString arch5_r = IdString(),
371 IdString arch6_r = IdString(),
372 IdString arch7_r = IdString(),
373 IdString arch8_r = IdString(),
374 IdString arch9_r = IdString() )
376 const CompatEntry & target( assertCompatSetEntry( targetArch_r ) );
377 target.addCompatBit( assertCompatSetEntry( arch0_r )._idBit );
378 #define _SETARG(N) if ( arch##N##_r.empty() ) return; target.addCompatBit( assertCompatSetEntry( arch##N##_r )._idBit )
457 : _entry( &ArchCompatSet::instance().assertDef( _noarch() ) )
461 : _entry( &ArchCompatSet::instance().assertDef(
IdString(id_r) ) )
465 : _entry( &ArchCompatSet::instance().assertDef( idstr_r ) )
469 : _entry( &ArchCompatSet::instance().assertDef( str_r ) )
473 : _entry( &ArchCompatSet::instance().assertDef( cstr_r ) )
542 if ( cset.size() > 2 )
544 return *(++cset.rbegin());
566 for ( ArchCompatSet::const_iterator it = ArchCompatSet::instance().begin();
567 it != ArchCompatSet::instance().end(); ++it )
569 if ( it->compatibleWith( *targetArch_r.
_entry ) )
571 ret.insert(
Arch(*it) );