diff options
author | Jason Greene <jason@php.net> | 2001-06-05 16:35:56 +0000 |
---|---|---|
committer | Jason Greene <jason@php.net> | 2001-06-05 16:35:56 +0000 |
commit | 9e5b0de828c419f8a9f84e167656b589ab9f6ef3 (patch) | |
tree | 65bd2ed2e6c956f0025963ee25930ebc8b2c24ab | |
parent | f6dc573f32b767747a09c1a2a5aa59b1be5f5e41 (diff) | |
download | php-git-9e5b0de828c419f8a9f84e167656b589ab9f6ef3.tar.gz |
Add the capibility to to allow ap_php_(v)snprintf to replace (v)snprintf
if the platform has a broken (v)snprintf, or in my case, if a library included
by a module redifines snprintf incorrectly.
-rw-r--r-- | main/php.h | 2 | ||||
-rw-r--r-- | main/snprintf.c | 2 | ||||
-rw-r--r-- | main/snprintf.h | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/main/php.h b/main/php.h index 24173462ab..e7f0f114ee 100644 --- a/main/php.h +++ b/main/php.h @@ -188,7 +188,7 @@ char *strerror(int); #define LONG_MIN (- LONG_MAX - 1) #endif -#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) || defined(BROKEN_SPRINTF) +#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) || defined(BROKEN_SPRINTF) || defined(BROKEN_SNPRINTF) || defined(BROKEN_VSNPRINTF) #include "snprintf.h" #endif diff --git a/main/snprintf.c b/main/snprintf.c index 1a84a08370..238cf2cf2e 100644 --- a/main/snprintf.c +++ b/main/snprintf.c @@ -55,7 +55,7 @@ #include "php.h" -#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) +#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) || defined(BROKEN_SNPRINTF) || defined(BROKEN_VSNPRINTF) #include <stdio.h> #include <ctype.h> diff --git a/main/snprintf.h b/main/snprintf.h index abd9bd1f04..3f9bb98503 100644 --- a/main/snprintf.h +++ b/main/snprintf.h @@ -19,12 +19,12 @@ #ifndef SNPRINTF_H #define SNPRINTF_H -#ifndef HAVE_SNPRINTF +#if !defined(HAVE_SNPRINTF) || defined(BROKEN_SNPRINTF) extern int ap_php_snprintf(char *, size_t, const char *, ...); #define snprintf ap_php_snprintf #endif -#ifndef HAVE_VSNPRINTF +#if !defined(HAVE_VSNPRINTF) || defined(BROKEN_VSNPRINTF) extern int ap_php_vsnprintf(char *, size_t, const char *, va_list ap); #define vsnprintf ap_php_vsnprintf #endif |