Skip to content

Commit

Permalink
Specialize macros for GCC
Browse files Browse the repository at this point in the history
Signed-off-by: Jed Brown <jed@59A2.org>
  • Loading branch information
jedbrown committed Nov 16, 2008
1 parent 82053c0 commit cc88196
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion include/dohptype.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,15 @@ static inline dScalar dSqr(dScalar a) { return a * a; }
#define dNAME_LEN 256
#define dSTR_LEN 256

#define dUNUSED __attribute__((unused))
#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
# define dUNUSED __attribute__((unused))
# define dLIKELY(x) __builtin_expect(!!(x),1)
# define dUNLIKELY(x) __builtin_expect(!!(x),0)
#else
# define dUNUSED
# define dLIKELY(x) (x)
# define dUNLIKELY(x) (x)
#endif

#define dFunctionBegin \
{\
Expand Down

0 comments on commit cc88196

Please sign in to comment.