7
/* TBB: strtok_r is not universal; provide an implementation of it. */
9
extern char *gd_strtok_r(char *s, char *sep, char **state);
11
/* These functions wrap memory management. gdFree is
12
in gd.h, where callers can utilize it to correctly
13
free memory allocated by these functions with the
14
right version of free(). */
15
#define gdCalloc(nmemb, size) ecalloc(nmemb, size)
16
#define gdMalloc(size) emalloc(size)
17
#define gdRealloc(ptr, size) erealloc(ptr, size)
18
#define gdEstrdup(ptr) estrdup(ptr)
19
#define gdFree(ptr) efree(ptr)
20
#define gdPMalloc(ptr) pemalloc(ptr, 1)
21
#define gdPFree(ptr) pefree(ptr, 1)
22
#define gdPEstrdup(ptr) pestrdup(ptr, 1)
25
#define gdMutexDeclare(x) MUTEX_T x
26
#define gdMutexSetup(x) x = tsrm_mutex_alloc()
27
#define gdMutexShutdown(x) tsrm_mutex_free(x)
28
#define gdMutexLock(x) tsrm_mutex_lock(x)
29
#define gdMutexUnlock(x) tsrm_mutex_unlock(x)
31
#define gdMutexDeclare(x)
32
#define gdMutexSetup(x)
33
#define gdMutexShutdown(x)
34
#define gdMutexLock(x)
35
#define gdMutexUnlock(x)
38
#endif /* GDHELPERS_H */