AC_REPLACE_FUNCS(strlcat strlcpy getopt)
AC_FUNC_UTIME_NULL
AC_FUNC_ALLOCA
-PHP_AC_BROKEN_SPRINTF
-PHP_AC_BROKEN_SNPRINTF
+dnl PHP_AC_BROKEN_SPRINTF
+dnl PHP_AC_BROKEN_SNPRINTF
PHP_DECLARED_TIMEZONE
PHP_TIME_R_TYPE
PHP_READDIR_R_TYPE
char *cvt;
register int i = 0, j = 0;
int sign, decpt, cvt_len;
+ char decimal_point = '.';
#ifdef HAVE_LOCALE_H
struct lconv lc;
- char decimal_point;
+ char locale_decimal_point;
localeconv_r(&lc);
- decimal_point = (lc.decimal_point)[0];
+ locale_decimal_point = (lc.decimal_point)[0];
#else
- char decimal_point = '.';
+ char locale_decimal_point = '.';
#endif
PRINTF_DEBUG(("sprintf: appenddouble(%x, %x, %x, %f, %d, '%c', %d, %c)\n",
numbuf[i++] = '+';
}
- if (fmt == 'f') {
+ if (fmt == 'f' || fmt == 'F') {
if (decpt <= 0) {
numbuf[i++] = '0';
if (precision > 0) {
int k = precision;
- numbuf[i++] = decimal_point;
+ numbuf[i++] = fmt == 'F' ? decimal_point : locale_decimal_point;
while ((decpt++ < 0) && k--) {
numbuf[i++] = '0';
}
numbuf[i++] = j < cvt_len ? cvt[j++] : '0';
}
if (precision > 0) {
- numbuf[i++] = decimal_point;
+ numbuf[i++] = fmt == 'F' ? decimal_point : locale_decimal_point;
while (precision-- > 0) {
numbuf[i++] = j < cvt_len ? cvt[j++] : '0';
}
case 'e':
case 'f':
+ case 'F':
/* XXX not done */
convert_to_double(tmp);
php_sprintf_appenddouble(&result, &outpos, &size,
#include "zend_API.h"
-#if PHP_BROKEN_SPRINTF
#undef sprintf
#define sprintf php_sprintf
-#endif
/* PHP's DEBUG value must match Zend's ZEND_DEBUG value */
#undef PHP_DEBUG
#define PHP_ATTRIBUTE_MALLOC ZEND_ATTRIBUTE_MALLOC
#define PHP_ATTRIBUTE_FORMAT ZEND_ATTRIBUTE_FORMAT
-#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) || PHP_BROKEN_SPRINTF || PHP_BROKEN_SNPRINTF || PHP_BROKEN_VSNPRINTF
#include "snprintf.h"
-#endif
#include "spprintf.h"
#define EXEC_INPUT_BUF 4096
#include "php_config.h"
#endif
-#if PHP_BROKEN_SPRINTF
-
int
php_sprintf (char*s, const char* format, ...)
{
return strlen (s);
}
-#endif /* PHP_BROKEN_SPRINTF */
-
/*
* Local variables:
* tab-width: 4
return (buf);
}
-#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) || PHP_BROKEN_SNPRINTF || PHP_BROKEN_VSNPRINTF
-
/*
* NUM_BUF_SIZE is the size of the buffer used for arithmetic conversions
*
return (cc);
}
-#endif /* HAVE_SNPRINTF */
-
/*
* Local variables:
* tab-width: 4
#ifndef SNPRINTF_H
#define SNPRINTF_H
-#if !defined(HAVE_SNPRINTF) || PHP_BROKEN_SNPRINTF
int ap_php_snprintf(char *, size_t, const char *, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
#define snprintf ap_php_snprintf
-#endif
-#if !defined(HAVE_VSNPRINTF) || PHP_BROKEN_VSNPRINTF
int ap_php_vsnprintf(char *, size_t, const char *, va_list ap) PHP_ATTRIBUTE_FORMAT(printf, 3, 0);
#define vsnprintf ap_php_vsnprintf
-#endif
-#if PHP_BROKEN_SPRINTF
int php_sprintf (char* s, const char* format, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3);
#define sprintf php_sprintf
-#endif
typedef enum {
NO = 0, YES = 1