diff options
author | Sascha Schumann <sas@php.net> | 2003-04-16 09:14:32 +0000 |
---|---|---|
committer | Sascha Schumann <sas@php.net> | 2003-04-16 09:14:32 +0000 |
commit | 0bda867fe777e3201778e6f170a6b107d735a35b (patch) | |
tree | 1d0822585a12237a34d33bd3853159073b0c5f48 /ext/standard/php_smart_str.h | |
parent | 8363658641ff70a9758f54c469543d87fa6880ad (diff) | |
download | php-git-0bda867fe777e3201778e6f170a6b107d735a35b.tar.gz |
Simplify use of this header in external apps
Diffstat (limited to 'ext/standard/php_smart_str.h')
-rw-r--r-- | ext/standard/php_smart_str.h | 11 |
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) |