]> granicus.if.org Git - php/commitdiff
Fixed undefiend referece at build time.
authorYasuo Ohgaki <yohgaki@php.net>
Wed, 4 Sep 2002 05:17:16 +0000 (05:17 +0000)
committerYasuo Ohgaki <yohgaki@php.net>
Wed, 4 Sep 2002 05:17:16 +0000 (05:17 +0000)
Fixed transilit test script.
Make fixes available on Windows.
Patch by Yoshimori Koizumi<readjust@deneb.freemail.ne.jp>

ext/iconv/config.m4
ext/iconv/iconv.c
ext/iconv/iconv.dsp
ext/iconv/php_iconv.h
ext/iconv/tests/translit.phpt

index 063937fa93af67872e064afdab58b04f1ff5f294..d075046ecd02b3b24a8c11a6d98baad180346707 100644 (file)
@@ -38,12 +38,14 @@ int main() {
 }
 ],[
        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)
   ], [
index 8252aa0844b811ed43d458e8ab94d18232f29983..ca100c78e3ad52d0f07adfe05a8096c2b9f0bf18 100644 (file)
 #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[] = {
@@ -141,7 +139,7 @@ static int php_iconv_string(const char *in_p, size_t in_len,
                                                        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;
@@ -175,7 +173,7 @@ static int php_iconv_string(const char *in_p, size_t in_len,
                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)) {
@@ -222,7 +220,7 @@ static int php_iconv_string(const char *in_p, size_t in_len,
        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 ) {
index 3ba74f84975f6bcc91bbb689615c2cdaa35ce8ba..946fa2dfb9cd149b92652cd3ca28ffe89eccf614 100644 (file)
@@ -43,7 +43,7 @@ RSC=rc.exe
 # 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
index 247f4cc615decba12b738ab3465b9964c73fdad8..5ee76c654980b3e6130d3c32623b216bbcf08fae 100644 (file)
 
 #ifdef PHP_ATOM_INC
 #include "php_have_iconv.h"
+#include "php_have_libiconv.h"
 #endif
 
 
-#if HAVE_ICONV
+#ifdef HAVE_ICONV
 extern zend_module_entry iconv_module_entry;
 #define iconv_module_ptr &iconv_module_entry
 
index 2d16d80ba0fe4b249bfbc9469d996bbb62fa08f9..c844fcd6e5b0822ebff80aa1f5632360f1399b35 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
 ICONV: LIBICONV transliteration (bug #16069)
 --SKIPIF--
-<?php include('skipif.inc'); if( iconv('CP932', 'EUC-JP//TRANSLIT', "\x87\x6d") == '' ) die("skip(no libiconv)\n"); ?>
+<?php include( 'skipif.inc' ); if( iconv('CP932', 'EUC-JP//TRANSLIT', "\x87\x6d") == '' ) die("skip\n"); ?>
 --POST--
 --GET--
 --FILE--