c_macro.h File Reference


Detailed Description

cynapses libc macro definitions

Definition in file c_macro.h.

Go to the source code of this file.

Defines

#define ARRAY_SIZE(a)   (sizeof(a)/sizeof(a[0]))
#define INT_TO_POINTER(i)   (void *) i
#define MAX(a, b)   ((a) < (b) ? (b) : (a))
#define MIN(a, b)   ((a) < (b) ? (a) : (b))
#define POINTER_TO_INT(p)   *((int *) (p))
#define SAFE_FREE(x)   do { if ((x) != NULL) {free((void*)x); x=NULL;} } while(0)
#define ZERO_STRUCT(x)   memset((char *)&(x), 0, sizeof(x))
#define ZERO_STRUCTP(x)   do { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); } while(0)


Generated on Mon Aug 18 13:53:10 2014 for doc by  doxygen 1.5.6