#include "config.h"
#endif
-#include "php.h"
-
#include "gd.h"
#include "gdhelpers.h"
#include <stdlib.h>
*state = s;
return result;
}
-
-void *
-gdCalloc (size_t nmemb, size_t size)
-{
- return ecalloc (nmemb, size);
-}
-
-void *
-gdMalloc (size_t size)
-{
- return emalloc (size);
-}
-
-void *
-gdRealloc (void *ptr, size_t size)
-{
- return erealloc (ptr, size);
-}
-
-void
-gdFree (void *ptr)
-{
- efree (ptr);
-}
-
-char *
-gdEstrdup (const char *ptr)
-{
- return estrdup(ptr);
-}
#define GDHELPERS_H 1
#include <sys/types.h>
+#include "php.h"
/* TBB: strtok_r is not universal; provide an implementation of it. */
in gd.h, where callers can utilize it to correctly
free memory allocated by these functions with the
right version of free(). */
-void *gdCalloc(size_t nmemb, size_t size);
-void *gdMalloc(size_t size);
-void *gdRealloc(void *ptr, size_t size);
-char *gdEstrdup(const char *ptr);
+#define gdCalloc(nmemb, size) ecalloc(nmemb, size)
+#define gdMalloc(size) emalloc(size)
+#define gdRealloc(ptr, size) erealloc(ptr, size)
+#define gdEstrdup(ptr) estrdup(ptr)
+#define gdFree(ptr) efree(ptr)
#endif /* GDHELPERS_H */