From: Sascha Schumann Date: Wed, 16 Apr 2003 09:14:32 +0000 (+0000) Subject: Simplify use of this header in external apps X-Git-Tag: RELEASE_0_5~27 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0bda867fe777e3201778e6f170a6b107d735a35b;p=php Simplify use of this header in external apps --- 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)