| 1 |
#ifndef _iduglobal_h |
| 2 |
#define _iduglobal_h |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
#ifndef offsetof |
| 23 |
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) |
| 24 |
#endif |
| 25 |
|
| 26 |
#ifndef cardinalityof |
| 27 |
#define cardinalityof(ARRAY) (sizeof (ARRAY) / sizeof ((ARRAY)[0])) |
| 28 |
#endif |
| 29 |
|
| 30 |
#ifndef strequ |
| 31 |
#define strequ(s1, s2) (strcmp ((s1), (s2)) == 0) |
| 32 |
#define strnequ(s1, s2, n) (strncmp ((s1), (s2), (n)) == 0) |
| 33 |
#endif |
| 34 |
|
| 35 |
#ifndef obstack_chunk_alloc |
| 36 |
#define obstack_chunk_alloc xmalloc |
| 37 |
#endif |
| 38 |
#ifndef obstack_chunk_free |
| 39 |
#define obstack_chunk_free free |
| 40 |
#endif |
| 41 |
|
| 42 |
#define CLONE(o, t, n) ((t *) memcpy (xmalloc (sizeof(t) * (n)), (o), sizeof (t) * (n))) |
| 43 |
|
| 44 |
#define DEBUG(args) |
| 45 |
|
| 46 |
#if HAVE_LINK |
| 47 |
#define MAYBE_FNM_CASEFOLD 0 |
| 48 |
#else |
| 49 |
#define MAYBE_FNM_CASEFOLD FNM_CASEFOLD |
| 50 |
#endif |
| 51 |
|
| 52 |
#if HAVE_LINK |
| 53 |
#define IS_ABSOLUTE(_dir_) ((_dir_)[0] == '/') |
| 54 |
#define SLASH_STRING "/" |
| 55 |
#define SLASH_CHAR '/' |
| 56 |
#define DOT_DOT_SLASH "../" |
| 57 |
#else |
| 58 |
|
| 59 |
#define IS_ABSOLUTE(_dir_) ((_dir_)[1] == ':') |
| 60 |
#define SLASH_STRING "\\/" |
| 61 |
#define SLASH_CHAR '\\' |
| 62 |
#define DOT_DOT_SLASH "..\\" |
| 63 |
#endif |
| 64 |
|
| 65 |
#define STREQ(a, b) (strcmp (a, b) == 0) |
| 66 |
|
| 67 |
static inline char * |
| 68 |
bad_cast (char const *s) |
| 69 |
{ |
| 70 |
return (char *) s; |
| 71 |
} |
| 72 |
|
| 73 |
#endif |