macros.hpp 2.13 KB
Newer Older
1 2 3 4 5

/******************************************************************************/
/*  0MQ Internal Use                                                          */
/******************************************************************************/

6 7 8 9 10 11
#define LIBZMQ_UNUSED(object) (void) object
#define LIBZMQ_DELETE(p_object)                                                \
    {                                                                          \
        delete p_object;                                                       \
        p_object = 0;                                                          \
    }
12 13

/******************************************************************************/
14 15 16 17 18 19 20 21

#if !defined ZMQ_NOEXCEPT
#if defined ZMQ_HAVE_NOEXCEPT
#define ZMQ_NOEXCEPT noexcept
#else
#define ZMQ_NOEXCEPT
#endif
#endif
22

23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
#if !defined ZMQ_OVERRIDE
#if defined ZMQ_HAVE_NOEXCEPT
#define ZMQ_OVERRIDE override
#else
#define ZMQ_OVERRIDE
#endif
#endif

#if !defined ZMQ_FINAL
#if defined ZMQ_HAVE_NOEXCEPT
#define ZMQ_FINAL final
#else
#define ZMQ_FINAL
#endif
#endif

39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
#if !defined ZMQ_DEFAULT
#if defined ZMQ_HAVE_NOEXCEPT
#define ZMQ_DEFAULT = default;
#else
#define ZMQ_DEFAULT                                                            \
    {                                                                          \
    }
#endif
#endif

#if !defined ZMQ_NON_COPYABLE_NOR_MOVABLE
#if defined ZMQ_HAVE_NOEXCEPT
#define ZMQ_NON_COPYABLE_NOR_MOVABLE(classname)                                \
  public:                                                                      \
    classname (const classname &) = delete;                                    \
    classname &operator= (const classname &) = delete;                         \
    classname (classname &&) = delete;                                         \
    classname &operator= (classname &&) = delete;
#else
#define ZMQ_NON_COPYABLE_NOR_MOVABLE(classname)                                \
  private:                                                                     \
    classname (const classname &);                                             \
    classname &operator= (const classname &);
#endif
#endif