diff options
-rw-r--r-- | main/php.h | 2 | ||||
-rw-r--r-- | main/php_sprintf.c | 7 | ||||
-rw-r--r-- | main/snprintf.c | 4 | ||||
-rw-r--r-- | main/snprintf.h | 15 |
4 files changed, 21 insertions, 7 deletions
diff --git a/main/php.h b/main/php.h index 1ea49e623f..6c886f2b4d 100644 --- a/main/php.h +++ b/main/php.h @@ -226,7 +226,9 @@ char *strerror(int); #define PHP_ATTRIBUTE_MALLOC ZEND_ATTRIBUTE_MALLOC #define PHP_ATTRIBUTE_FORMAT ZEND_ATTRIBUTE_FORMAT +BEGIN_EXTERN_C() #include "snprintf.h" +END_EXTERN_C() #include "spprintf.h" #define EXEC_INPUT_BUF 4096 diff --git a/main/php_sprintf.c b/main/php_sprintf.c index b0589c20a2..e18bd25c41 100644 --- a/main/php_sprintf.c +++ b/main/php_sprintf.c @@ -20,13 +20,16 @@ #include <stdio.h> #include <stdarg.h> -#ifdef NETWARE +#include "php.h" +#ifdef PHP_WIN32 +#include "config.w32.h" +#elif defined NETWARE #include "config.nw.h" #else #include "php_config.h" #endif -int +PHPAPI int php_sprintf (char*s, const char* format, ...) { va_list args; diff --git a/main/snprintf.c b/main/snprintf.c index e0804b07d7..4cb9b5c91c 100644 --- a/main/snprintf.c +++ b/main/snprintf.c @@ -1135,7 +1135,7 @@ static void strx_printv(int *ccp, char *buf, size_t len, const char *format, } -int ap_php_snprintf(char *buf, size_t len, const char *format,...) +PHPAPI int ap_php_snprintf(char *buf, size_t len, const char *format,...) { int cc; va_list ap; @@ -1147,7 +1147,7 @@ int ap_php_snprintf(char *buf, size_t len, const char *format,...) } -int ap_php_vsnprintf(char *buf, size_t len, const char *format, va_list ap) +PHPAPI int ap_php_vsnprintf(char *buf, size_t len, const char *format, va_list ap) { int cc; diff --git a/main/snprintf.h b/main/snprintf.h index a6d98793b2..2eb284a288 100644 --- a/main/snprintf.h +++ b/main/snprintf.h @@ -64,13 +64,22 @@ Example: #ifndef SNPRINTF_H #define SNPRINTF_H -int ap_php_snprintf(char *, size_t, const char *, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); +PHPAPI int ap_php_snprintf(char *, size_t, const char *, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); +#ifdef snprintf +#undef snprintf +#endif #define snprintf ap_php_snprintf -int ap_php_vsnprintf(char *, size_t, const char *, va_list ap) PHP_ATTRIBUTE_FORMAT(printf, 3, 0); +PHPAPI int ap_php_vsnprintf(char *, size_t, const char *, va_list ap) PHP_ATTRIBUTE_FORMAT(printf, 3, 0); +#ifdef vsnprintf +#undef vsnprintf +#endif #define vsnprintf ap_php_vsnprintf -int php_sprintf (char* s, const char* format, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3); +PHPAPI int php_sprintf (char* s, const char* format, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3); +#ifdef sprintf +#undef sprintf +#endif #define sprintf php_sprintf typedef enum { |