Crossfire Server, Trunk  R22047
compat.h
Go to the documentation of this file.
1 
6 #ifndef _COMPAT_H
7 #define _COMPAT_H
8 
9 // Maintain backward compatibility with original macros.
10 #define TRUE true
11 #define FALSE false
12 #define FMT64 PRId64
13 #define FMT64U PRIu64
14 
15 
16 #ifndef MIN
17 #define MIN(x, y) ((x) < (y) ? (x) : (y))
18 #endif
19 #ifndef MAX
20 #define MAX(x, y) ((x) > (y) ? (x) : (y))
21 #endif
22 
23 #define safe_strncpy strlcpy
24 #define strcasestr_local strcasestr
25 #define strdup_local strdup
26 
27 #define CALLOC(x, y) calloc(x, y)
28 #define object_decrease_nrof_by_one(xyz) object_decrease_nrof(xyz, 1)
29 
30 void safe_strcat(char *dest, const char *orig, size_t *curlen, size_t maxlen);
31 
32 #if 0
33 #ifndef HAVE_STRCASESTR
34 char *strcasestr(const char *s, const char *find);
35 #endif
36 
37 #ifndef HAVE_STRDUP
38 char *strdup(const char *str);
39 #endif
40 #endif
41 
42 #ifndef HAVE_STRLCPY
43 size_t strlcpy(char *dst, const char *src, size_t size);
44 #endif
45 
46 #if 0
47 #ifndef HAVE_TEMPNAM
48 char *tempnam(const char *tmpdir, const char *prefix);
49 #endif
50 #endif
51 
52 #endif
void safe_strcat(char *dest, const char *orig, size_t *curlen, size_t maxlen)
Definition: porting.c:350
size_t strlcpy(char *dst, const char *src, size_t size)
Definition: porting.c:370