Pārlūkot izejas kodu

avoid defining public symbols for internal faked iconv functions

Michael van Elst 22 gadi atpakaļ
vecāks
revīzija
148f8b54d6
2 mainītis faili ar 75 papildinājumiem un 1 dzēšanām
  1. 72 0
      gd/gd.patch
  2. 3 1
      gd/gd.spec

+ 72 - 0
gd/gd.patch

@@ -0,0 +1,72 @@
+--- gdkanji.c.dist	2003-07-25 10:05:16.000000000 +0200
++++ gdkanji.c	2003-07-25 10:07:43.000000000 +0200
+@@ -27,29 +27,32 @@
+ 
+ #ifndef HAVE_ICONV
+ #define ICONV_CONST /**/
+-  iconv_t iconv_open (const char *, const char *);
+-size_t iconv (iconv_t, ICONV_CONST char **, size_t *, char **, size_t *);
+-int iconv_close (iconv_t);
++static iconv_t my_iconv_open (const char *, const char *);
++static size_t my_iconv (iconv_t, ICONV_CONST char **, size_t *, char **, size_t *);
++static int my_iconv_close (iconv_t);
+ 
+-iconv_t
+-iconv_open (const char *tocode, const char *fromcode)
++static iconv_t
++my_iconv_open (const char *tocode, const char *fromcode)
+ {
+   return (iconv_t) (-1);
+ }
+ 
+-size_t
+-iconv (iconv_t cd, ICONV_CONST char **inbuf, size_t * inbytesleft,
++static size_t
++my_iconv (iconv_t cd, ICONV_CONST char **inbuf, size_t * inbytesleft,
+        char **outbuf, size_t * outbytesleft)
+ {
+   return 0;
+ }
+ 
+-int
+-iconv_close (iconv_t cd)
++static int
++my_iconv_close (iconv_t cd)
+ {
+   return 0;
+ }
+-
++#else
++#define my_iconv_open iconv_open
++#define my_iconv iconv
++#define my_iconv_close iconv_close
+ #endif /* !HAVE_ICONV */
+ 
+ #define LIBNAME "any2eucjp()"
+@@ -377,7 +380,7 @@
+   iconv_t cd;
+   size_t from_len, to_len;
+ 
+-  if ((cd = iconv_open (EUCSTR, code)) == (iconv_t) - 1)
++  if ((cd = my_iconv_open (EUCSTR, code)) == (iconv_t) - 1)
+     {
+       error ("iconv_open() error");
+ #ifdef HAVE_ERRNO_H
+@@ -391,7 +394,7 @@
+   from_len = strlen ((const char *) from) + 1;
+   to_len = BUFSIZ;
+ 
+-  if ((int) (iconv (cd, (char **) &from, &from_len, (char **) &to, &to_len))
++  if ((int) (my_iconv (cd, (char **) &from, &from_len, (char **) &to, &to_len))
+       == -1)
+     {
+ #ifdef HAVE_ERRNO_H
+@@ -408,7 +411,7 @@
+       return;
+     }
+ 
+-  if (iconv_close (cd) != 0)
++  if (my_iconv_close (cd) != 0)
+     {
+       error ("iconv_close() error");
+     }

+ 3 - 1
gd/gd.spec

@@ -33,10 +33,11 @@ Distribution: OpenPKG [BASE]
 Group:        Graphics
 License:      GPL
 Version:      2.0.15
-Release:      20030709
+Release:      20030725
 
 #   list of sources
 Source0:      http://www.boutell.com/gd/http/gd-%{version}.tar.gz
+Patch0:       gd.patch
 
 #   build information
 Prefix:       %{l_prefix}
@@ -56,6 +57,7 @@ AutoReqProv:  no
 
 %prep
     %setup -q
+    %patch -p0
 
 %build
     ( echo "ac_cv_header_iconv_h=no"