~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/global.h

Merge Trond

Show diffs side-by-side

added added

removed removed

Lines of Context:
249
249
#define ALIGN_PTR(A, t) ((t*) MY_ALIGN((A),sizeof(t)))
250
250
/* Offset of field f in structure t */
251
251
#define OFFSET(t, f)  ((size_t)(char *)&((t *)0)->f)
 
252
#ifdef __cplusplus
 
253
#define ADD_TO_PTR(ptr,size,type) (type) (reinterpret_cast<const unsigned char*>(ptr)+size)
 
254
#define PTR_BYTE_DIFF(A,B) (ptrdiff_t) (reinterpret_cast<const unsigned char*>(A) - reinterpret_cast<const unsigned char*>(B))
 
255
#else
252
256
#define ADD_TO_PTR(ptr,size,type) (type) ((unsigned char*) (ptr)+size)
253
257
#define PTR_BYTE_DIFF(A,B) (ptrdiff_t) ((unsigned char*) (A) - (unsigned char*) (B))
 
258
#endif
254
259
 
255
260
#define MY_DIV_UP(A, B) (((A) + (B) - 1) / (B))
256
261
#define MY_ALIGNED_BYTE_ARRAY(N, S, T) T N[MY_DIV_UP(S, sizeof(T))]