~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/global.h

  • Committer: Monty Taylor
  • Date: 2008-10-05 01:08:28 UTC
  • Revision ID: monty@inaugust.com-20081005010828-unkb3ynt73e7lmni
Moved compile_time_assert.

Show diffs side-by-side

added added

removed removed

Lines of Context:
119
119
*/
120
120
#include <assert.h>
121
121
 
122
 
/* an assert that works at compile-time. only for constant expression */
123
 
#ifndef __GNUC__
124
 
#define compile_time_assert(X)  do { } while(0)
125
 
#else
126
 
#define compile_time_assert(X)                                  \
127
 
  do                                                            \
128
 
  {                                                             \
129
 
    char compile_time_assert[(X) ? 1 : -1]                      \
130
 
      __attribute__ ((unused));                                 \
131
 
  } while(0)
132
 
#endif
133
 
 
134
122
/* Declare madvise where it is not declared for C++, like Solaris */
135
123
#if defined(HAVE_MADVISE) && !defined(HAVE_DECL_MADVISE) && defined(__cplusplus)
136
124
extern "C" int madvise(void *addr, size_t len, int behav);