}
],[
AC_MSG_RESULT(yes)
- AC_DEFINE(ICONV_SUPPORTS_ERRNO,1,[Whether iconv supports error no or not])
+ PHP_DEFINE([ICONV_SUPPORTS_ERRNO],1)
+ AC_DEFINE(ICONV_SUPPORTS_ERRNO,1,[Whether iconv supports error no or not])
],[
+ PHP_DEFINE([ICONV_SUPPORTS_ERRNO],0)
+ AC_DEFINE(ICONV_SUPPORTS_ERRNO,0,[Whether iconv supports error no or not])
AC_MSG_RESULT(no)
])
- AC_DEFINE(HAVE_ICONV,1,[Whether to build ICONV support or not])
PHP_NEW_EXTENSION(iconv, iconv.c, $ext_shared)
PHP_SUBST(ICONV_SHARED_LIBADD)
], [
#endif
#include "php.h"
+#include "php_globals.h"
+#include "ext/standard/info.h"
+#include "main/php_output.h"
+#include "SAPI.h"
+#include "php_ini.h"
-#if HAVE_ICONV
+#include <errno.h>
+
+#include "php_iconv.h"
+
+#ifdef HAVE_ICONV
#ifdef HAVE_GICONV_H
#include <giconv.h>
#include <iconv.h>
#endif
-#include <errno.h>
-
-#include "php_globals.h"
-#include "php_iconv.h"
-#include "ext/standard/info.h"
-#include "main/php_output.h"
-#include "SAPI.h"
-#include "php_ini.h"
-
-
-#if HAVE_LIBICONV
+#ifdef HAVE_LIBICONV
#define LIBICONV_PLUG
#define icv_open(a, b) libiconv_open(a, b)
#define icv_close(a) libiconv_close(a)
#else
#define icv_open(a, b) iconv_open(a, b)
#define icv_close(a) iconv_close(a)
-#define icv(a, b, c, d, e) iconv(a, b, c, d, e)
+#define icv(a, b, c, d, e) iconv(a, (char **) b, c, d, e)
#endif
-
/* {{{ iconv_functions[]
*/
function_entry iconv_functions[] = {
char **out, size_t *out_len,
const char *in_charset, const char *out_charset, int *err TSRMLS_DC)
{
-#if !defined(ICONV_SUPPORTS_ERRNO)
+#if ICONV_SUPPORTS_ERRNO
unsigned int in_size, out_size, out_left;
char *out_buffer, *out_p;
iconv_t cd;
return FAILURE;
}
- result = icv(cd, (char **) &in_p, &in_size, (char **)
+ result = icv(cd, (const char **) &in_p, &in_size, (char **)
&out_p, &out_left);
if (result == (size_t)(-1)) {
out_p = out_buf;
while(in_left > 0) {
- result = icv(cd, (const char **)&in_p, &in_left, (char **) &out_p, &out_left);
+ result = icv(cd, (const char **) &in_p, &in_left, (char **) &out_p, &out_left);
out_size = bsz - out_left;
if( result == (size_t)(-1) ) {
if( errno == E2BIG && in_left > 0 ) {
# PROP Ignore_Export_Lib 0\r
# PROP Target_Dir ""\r
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ICONV_EXPORTS" /YX /FD /c\r
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /I "..\..\win32" /I "..\..\..\php_build\iconv\include" /D "WIN32" /D "PHP_EXPORTS" /D "COMPILE_DL_ICONV" /D "HAVE_ICONV" /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZTS=1 /D "HAVE_LIBICONV" /YX /FD /c\r
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /I "..\..\win32" /I "..\..\..\php_build\iconv\include" /D "WIN32" /D "PHP_EXPORTS" /D "COMPILE_DL_ICONV" /D "HAVE_ICONV" /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZTS=1 /D "ICONV_SUPPORTS_ERRNO" /D "HAVE_LIBICONV" /YX /FD /c\r
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
# ADD BASE RSC /l 0x407 /d "NDEBUG"\r