Ticket #6273: 6273_config.diff

File 6273_config.diff, 1.3 KB (added by viboes, 11 years ago)

Strong enum type macros to support enum cmass emulation fro cv_status

  • boost/thread/detail/config.hpp

     
    1919#endif
    2020#endif
    2121
     22#ifdef BOOST_NO_SCOPED_ENUMS
     23#define BOOST_DECLARE_STRONG_ENUM_BEGIN(x) \
     24  struct x { \
     25    enum enum_type
     26
     27#define BOOST_DECLARE_STRONG_ENUM_END(x) \
     28    enum_type v_; \
     29    inline x()  {} \
     30    inline x(enum_type v) : v_(v) {} \
     31    inline operator int() const {return v_;} \
     32    friend inline bool operator ==(x lhs, int rhs)  {return lhs.v_==rhs;} \
     33    friend inline bool operator ==(int lhs, x rhs)  {return lhs==rhs.v_;} \
     34    friend inline bool operator !=(x lhs, int rhs)  {return lhs.v_!=rhs;} \
     35    friend inline bool operator !=(int lhs, x rhs)  {return lhs!=rhs.v_;} \
     36  };
     37
     38#define BOOST_STRONG_ENUM_NATIVE(x) x::type
     39#else  // BOOST_NO_SCOPED_ENUMS
     40#define BOOST_DECLARE_STRONG_ENUM_BEGIN(x) enum class BOOST_SYMBOL_VISIBLE x
     41#define BOOST_DECLARE_STRONG_ENUM_END(x)
     42#define BOOST_STRONG_ENUM_NATIVE(x) x
     43#endif  // BOOST_NO_SCOPED_ENUMS
     44
    2245#if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
    2346#  pragma warn -8008 // Condition always true/false
    2447#  pragma warn -8080 // Identifier declared but never used