128 {
return ! ( lhs == rhs ); }
155 #define DEF_BUILTIN(A) static inline const IdString & _##A () { static IdString __str(#A); return __str; }
223 typedef Arch::CompatEntry CompatEntry;
226 typedef std::tr1::unordered_set<CompatEntry> Set;
227 typedef Set::iterator iterator;
228 typedef Set::const_iterator const_iterator;
231 static ArchCompatSet & instance()
233 static ArchCompatSet _instance;
240 const Arch::CompatEntry & assertDef(
const std::string & archStr_r )
241 {
return *
_compatSet.insert( Arch::CompatEntry( archStr_r ) ).first; }
243 const Arch::CompatEntry & assertDef( IdString archStr_r )
244 {
return *
_compatSet.insert( Arch::CompatEntry( archStr_r ) ).first; }
246 const_iterator begin()
const
249 const_iterator end()
const
254 int operator()(
const CompatEntry & lhs,
const CompatEntry & rhs )
const
255 {
return lhs._idBit.value() < rhs._idBit.value(); }
258 std::ostream &
dumpOn( std::ostream & str )
const
260 str <<
"ArchCompatSet:";
262 ov.sort( DumpOnCompare() );
263 for_( it, ov.begin(), ov.end() )
265 str << endl <<
' ' << *it;
277 _compatSet.insert( Arch::CompatEntry( _noarch(), 0 ) );
284 defCompatibleWith( _i386(), _noarch() );
285 defCompatibleWith( _i486(), _noarch(),_i386() );
286 defCompatibleWith( _i586(), _noarch(),_i386(),_i486() );
287 defCompatibleWith( _i686(), _noarch(),_i386(),_i486(),_i586() );
288 defCompatibleWith( _athlon(), _noarch(),_i386(),_i486(),_i586(),_i686() );
289 defCompatibleWith( _x86_64(), _noarch(),_i386(),_i486(),_i586(),_i686(),_athlon() );
291 defCompatibleWith( _pentium3(), _noarch(),_i386(),_i486(),_i586(),_i686() );
292 defCompatibleWith( _pentium4(), _noarch(),_i386(),_i486(),_i586(),_i686(),_pentium3() );
294 defCompatibleWith( _ia64(), _noarch(),_i386(),_i486(),_i586(),_i686() );
296 defCompatibleWith( _s390(), _noarch() );
297 defCompatibleWith( _s390x(), _noarch(),_s390() );
299 defCompatibleWith( _ppc(), _noarch() );
300 defCompatibleWith( _ppc64(), _noarch(),_ppc() );
302 defCompatibleWith( _alpha(), _noarch() );
303 defCompatibleWith( _alphaev5(), _noarch(),_alpha() );
304 defCompatibleWith( _alphaev56(), _noarch(),_alpha(),_alphaev5() );
305 defCompatibleWith( _alphapca56(), _noarch(),_alpha(),_alphaev5(),_alphaev56() );
306 defCompatibleWith( _alphaev6(), _noarch(),_alpha(),_alphaev5(),_alphaev56(),_alphapca56() );
307 defCompatibleWith( _alphaev67(), _noarch(),_alpha(),_alphaev5(),_alphaev56(),_alphapca56(),_alphaev6() );
309 defCompatibleWith( _sparc(), _noarch() );
310 defCompatibleWith( _sparcv8(), _noarch(),_sparc() );
311 defCompatibleWith( _sparcv9(), _noarch(),_sparc(),_sparcv8() );
312 defCompatibleWith( _sparcv9v(), _noarch(),_sparc(),_sparcv8(),_sparcv9() );
314 defCompatibleWith( _sparc64(), _noarch(),_sparc(),_sparcv8(),_sparcv9() );
315 defCompatibleWith( _sparc64v(), _noarch(),_sparc(),_sparcv8(),_sparcv9(),_sparcv9v(),_sparc64() );
317 defCompatibleWith( _armv3l(), _noarch() );
318 defCompatibleWith( _armv4l(), _noarch(),_armv3l() );
319 defCompatibleWith( _armv4tl(), _noarch(),_armv3l(),_armv4l() );
320 defCompatibleWith( _armv5l(), _noarch(),_armv3l(),_armv4l(),_armv4tl() );
321 defCompatibleWith( _armv5tel(), _noarch(),_armv3l(),_armv4l(),_armv4tl(),_armv5l() );
322 defCompatibleWith( _armv5tejl(), _noarch(),_armv3l(),_armv4l(),_armv4tl(),_armv5l(),_armv5tel() );
323 defCompatibleWith( _armv6l(), _noarch(),_armv3l(),_armv4l(),_armv4tl(),_armv5l(),_armv5tel(),_armv5tejl() );
324 defCompatibleWith( _armv7l(), _noarch(),_armv3l(),_armv4l(),_armv4tl(),_armv5l(),_armv5tel(),_armv5tejl(),_armv6l() );
325 defCompatibleWith( _armv7hl(), _noarch() );
326 defCompatibleWith( _armv7nhl(), _noarch(),_armv7hl() );
327 defCompatibleWith( _armv7thl(), _noarch(),_armv7hl() );
328 defCompatibleWith( _armv7tnhl(), _noarch(),_armv7hl(),_armv7nhl(),_armv7thl() );
329 defCompatibleWith( _aarch64(), _noarch() );
331 defCompatibleWith( _sh3(), _noarch() );
333 defCompatibleWith( _sh4(), _noarch() );
334 defCompatibleWith( _sh4a(), _noarch(),_sh4() );
352 ZYPP_THROW( Exception(
"Need more bits to encode architectures.") );
361 const CompatEntry & assertCompatSetEntry( IdString archStr_r )
362 {
return *
_compatSet.insert( Arch::CompatEntry( archStr_r, nextIdBit() ) ).first; }
366 void defCompatibleWith( IdString targetArch_r,
368 IdString arch1_r = IdString(),
369 IdString arch2_r = IdString(),
370 IdString arch3_r = IdString(),
371 IdString arch4_r = IdString(),
372 IdString arch5_r = IdString(),
373 IdString arch6_r = IdString(),
374 IdString arch7_r = IdString(),
375 IdString arch8_r = IdString(),
376 IdString arch9_r = IdString() )
378 const CompatEntry & target( assertCompatSetEntry( targetArch_r ) );
379 target.addCompatBit( assertCompatSetEntry( arch0_r )._idBit );
380 #define _SETARG(N) if ( arch##N##_r.empty() ) return; target.addCompatBit( assertCompatSetEntry( arch##N##_r )._idBit )
460 : _entry( &ArchCompatSet::instance().assertDef( _noarch() ) )
464 : _entry( &ArchCompatSet::instance().assertDef(
IdString(id_r) ) )
468 : _entry( &ArchCompatSet::instance().assertDef( idstr_r ) )
472 : _entry( &ArchCompatSet::instance().assertDef( str_r ) )
476 : _entry( &ArchCompatSet::instance().assertDef( cstr_r ) )
545 if ( cset.size() > 2 )
547 return *(++cset.rbegin());
569 for ( ArchCompatSet::const_iterator it = ArchCompatSet::instance().begin();
570 it != ArchCompatSet::instance().end(); ++it )
572 if ( it->compatibleWith( *targetArch_r.
_entry ) )
574 ret.insert(
Arch(*it) );