From 0bda867fe777e3201778e6f170a6b107d735a35b Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Wed, 16 Apr 2003 09:14:32 +0000 Subject: [PATCH] Simplify use of this header in external apps --- ext/standard/php_smart_str.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 +#ifndef SMART_STR_USE_REALLOC #include +#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) -- 2.50.1