Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Macro expansion happens too soon
  • Loading branch information
kkoopa committed Nov 3, 2014
1 parent 31c6612 commit e15c720
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions nan.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,24 @@
#endif
#include <string>

#define notset(x) (!defined(x) || !x)

#if defined(__GNUC__) && notset(DEBUG)
#if defined(__GNUC__) && !(defined(DEBUG) && DEBUG)
# define NAN_INLINE inline __attribute__((always_inline))
#elif defined(_MSC_VER) && notset(DEBUG)
#elif defined(_MSC_VER) && !(defined(DEBUG) && DEBUG)
# define NAN_INLINE __forceinline
#else
# define NAN_INLINE inline
#endif

#if defined(__GNUC__) && notset(V8_DISABLE_DEPRECATIONS)
#if defined(__GNUC__) && \
!(defined(V8_DISABLE_DEPRECATIONS) && V8_DISABLE_DEPRECATIONS)
# define NAN_DEPRECATED __attribute__((deprecated))
#elif defined(_MSC_VER) && notset(V8_DISABLE_DEPRECATIONS)
#elif defined(_MSC_VER) && \
!(defined(V8_DISABLE_DEPRECATIONS) && V8_DISABLE_DEPRECATIONS)
# define NAN_DEPRECATED __declspec(deprecated)
#else
# define NAN_DEPRECATED
#endif

#undef notset

// some generic helpers

template<typename T> NAN_INLINE bool NanSetPointerSafe(
Expand Down

0 comments on commit e15c720

Please sign in to comment.