summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2003-04-16 09:14:32 +0000
committerSascha Schumann <sas@php.net>2003-04-16 09:14:32 +0000
commit0bda867fe777e3201778e6f170a6b107d735a35b (patch)
tree1d0822585a12237a34d33bd3853159073b0c5f48
parent8363658641ff70a9758f54c469543d87fa6880ad (diff)
downloadphp-git-0bda867fe777e3201778e6f170a6b107d735a35b.tar.gz
Simplify use of this header in external apps
-rw-r--r--ext/standard/php_smart_str.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/standard/php_smart_str.h b/ext/standard/php_smart_str.h
index 8622a2efab..8ee845079a 100644
--- a/ext/standard/php_smart_str.h
+++ b/ext/standard/php_smart_str.h
@@ -22,7 +22,9 @@
#include "php_smart_str_public.h"
#include <stdlib.h>
+#ifndef SMART_STR_USE_REALLOC
#include <zend.h>
+#endif
#define smart_str_0(x) do { \
if ((x)->c) { \
@@ -34,12 +36,19 @@
#define SMART_STR_PREALLOC 128
#endif
+#ifdef SMART_STR_USE_REALLOC
+#define SMART_STR_REALLOC(a,b,c) realloc((a),(b))
+#else
+#define SMART_STR_REALLOC(a,b,c) perealloc((a),(b),(c))
+#endif
+
+
#define smart_str_alloc4(d, n, what, newlen) do { \
if (!(d)->c) (d)->len = (d)->a = 0; \
newlen = (d)->len + (n); \
if (newlen >= (d)->a) { \
(d)->a = newlen + SMART_STR_PREALLOC; \
- (d)->c = perealloc((d)->c, (d)->a + 1, (what)); \
+ (d)->c = SMART_STR_REALLOC((d)->c, (d)->a + 1, (what)); \
} \
} while (0)