utils.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef parserutils_utils_h_
00009 #define parserutils_utils_h_
00010
00011 #ifndef max
00012 #define max(a,b) ((a)>(b)?(a):(b))
00013 #endif
00014
00015 #ifndef min
00016 #define min(a,b) ((a)<(b)?(a):(b))
00017 #endif
00018
00019 #ifndef SLEN
00020
00021 #define SLEN(s) (sizeof((s)) - 1)
00022 #endif
00023
00024 #ifndef UNUSED
00025 #define UNUSED(x) ((x)=(x))
00026 #endif
00027
00028 #ifndef N_ELEMENTS
00029 #define N_ELEMENTS(s) (sizeof((s)) / sizeof((s)[0]))
00030 #endif
00031
00032 #ifndef ALIGN
00033 #define ALIGN(val) (((val) + 3) & ~(3))
00034 #endif
00035
00036 #endif