patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-4.0-iconvdata.patch
changeset 1 eeea35fbf182
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-4.0-iconvdata.patch	Sat Feb 24 11:00:05 2007 +0000
     1.3 @@ -0,0 +1,114 @@
     1.4 +Fixes
     1.5 +
     1.6 +In file included from jis0208.c:23:
     1.7 +jis0208.h:32: error: array type has incomplete element type
     1.8 +when building with gcc-4.0
     1.9 +
    1.10 +In file included from cp1258.c:869:
    1.11 +../iconv/skeleton.c: In function 'gconv':
    1.12 +../iconv/skeleton.c:323: error: invalid lvalue in increment
    1.13 +
    1.14 +In file included from cp1255.c:550:
    1.15 +../iconv/skeleton.c: In function 'gconv':
    1.16 +../iconv/skeleton.c:323: error: invalid lvalue in increment
    1.17 +
    1.18 +In file included from gb18030.c:22114:
    1.19 +../iconv/loop.c: In function 'from_gb18030':
    1.20 +../iconv/loop.c:282: error: invalid lvalue in increment
    1.21 +../iconv/loop.c: In function 'from_gb18030_single':
    1.22 +../iconv/loop.c:384: error: invalid lvalue in increment
    1.23 +
    1.24 +--- /home/dank/downloads/glibc-2.2.5/iconvdata/iso8859-1.c	2001-08-03 15:06:50.000000000 -0700
    1.25 ++++ glibc-2.2.5/iconvdata/iso8859-1.c	2005-03-11 15:09:15.233602808 -0800
    1.26 +@@ -35,7 +35,8 @@
    1.27 + #define MIN_NEEDED_OUTPUT	MIN_NEEDED_TO
    1.28 + #define LOOPFCT			FROM_LOOP
    1.29 + #define BODY \
    1.30 +-  *((uint32_t *) outptr)++ = *inptr++;
    1.31 ++  *((uint32_t *) outptr) = *inptr++;					      \
    1.32 ++  outptr += sizeof (uint32_t);
    1.33 + #include <iconv/loop.c>
    1.34 + 
    1.35 + 
    1.36 +--- /home/dank/downloads/glibc-2.2.5/iconvdata/jis0208.h	2001-07-05 21:54:52.000000000 -0700
    1.37 ++++ glibc-2.2.5/iconvdata/jis0208.h	2005-03-11 15:27:23.295192304 -0800
    1.38 +@@ -24,15 +24,6 @@
    1.39 + #include <gconv.h>
    1.40 + #include <stdint.h>
    1.41 + 
    1.42 +-/* Conversion table.  */
    1.43 +-extern const uint16_t __jis0208_to_ucs[];
    1.44 +-
    1.45 +-extern const char __jisx0208_from_ucs4_lat1[256][2];
    1.46 +-extern const char __jisx0208_from_ucs4_greek[0xc1][2];
    1.47 +-extern const struct jisx0208_ucs_idx __jisx0208_from_ucs_idx[];
    1.48 +-extern const char __jisx0208_from_ucs_tab[][2];
    1.49 +-
    1.50 +-
    1.51 + /* Struct for table with indeces in UCS mapping table.  */
    1.52 + struct jisx0208_ucs_idx
    1.53 + {
    1.54 +@@ -42,6 +33,15 @@
    1.55 + };
    1.56 + 
    1.57 + 
    1.58 ++/* Conversion table.  */
    1.59 ++extern const uint16_t __jis0208_to_ucs[];
    1.60 ++
    1.61 ++extern const char __jisx0208_from_ucs4_lat1[256][2];
    1.62 ++extern const char __jisx0208_from_ucs4_greek[0xc1][2];
    1.63 ++extern const struct jisx0208_ucs_idx __jisx0208_from_ucs_idx[];
    1.64 ++extern const char __jisx0208_from_ucs_tab[][2];
    1.65 ++
    1.66 ++
    1.67 + static inline uint32_t
    1.68 + jisx0208_to_ucs4 (const unsigned char **s, size_t avail, unsigned char offset)
    1.69 + {
    1.70 +--- /home/dank/downloads/glibc-2.2.5/iconvdata/cp1258.c	2001-07-05 21:54:49.000000000 -0700
    1.71 ++++ glibc-2.2.5/iconvdata/cp1258.c	2005-03-11 15:41:44.953200376 -0800
    1.72 +@@ -66,7 +66,8 @@
    1.73 + 	  if (__builtin_expect (outbuf + 4 <= outend, 1))		      \
    1.74 + 	    {								      \
    1.75 + 	      /* Write out the last character.  */			      \
    1.76 +-	      *((uint32_t *) outbuf)++ = data->__statep->__count >> 3;	      \
    1.77 ++	      *((uint32_t *) outbuf) = data->__statep->__count >> 3;	      \
    1.78 ++	      outbuf += sizeof (uint32_t);				      \
    1.79 + 	      data->__statep->__count = 0;				      \
    1.80 + 	    }								      \
    1.81 + 	  else								      \
    1.82 +--- /home/dank/downloads/glibc-2.2.5/iconvdata/cp1255.c	2001-07-05 21:54:49.000000000 -0700
    1.83 ++++ glibc-2.2.5/iconvdata/cp1255.c	2005-03-11 15:47:40.689120296 -0800
    1.84 +@@ -65,7 +65,8 @@
    1.85 + 	  if (__builtin_expect (outbuf + 4 <= outend, 1))		      \
    1.86 + 	    {								      \
    1.87 + 	      /* Write out the last character.  */			      \
    1.88 +-	      *((uint32_t *) outbuf)++ = data->__statep->__count >> 3;	      \
    1.89 ++	      *((uint32_t *) outbuf) = data->__statep->__count >> 3;	      \
    1.90 ++	      outbuf += sizeof (uint32_t);				      \
    1.91 + 	      data->__statep->__count = 0;				      \
    1.92 + 	    }								      \
    1.93 + 	  else								      \
    1.94 +--- /home/dank/downloads/glibc-2.2.5/iconvdata/gb18030.c	2001-08-03 15:06:47.000000000 -0700
    1.95 ++++ glibc-2.2.5/iconvdata/gb18030.c	2005-03-11 15:54:59.060477720 -0800
    1.96 +@@ -22108,7 +22108,8 @@
    1.97 + 	    }							      	      \
    1.98 + 	}								      \
    1.99 + 									      \
   1.100 +-    *((uint32_t *) outptr)++ = ch;					      \
   1.101 ++    *((uint32_t *) outptr) = ch;					      \
   1.102 ++    outptr += sizeof (uint32_t);					      \
   1.103 +   }
   1.104 + #define LOOP_NEED_FLAGS
   1.105 + #include <iconv/loop.c>
   1.106 +--- /home/dank/downloads/glibc-2.2.5/iconvdata/iso-2022-cn-ext.c	2001-07-05 21:54:51.000000000 -0700
   1.107 ++++ glibc-2.2.5/iconvdata/iso-2022-cn-ext.c	2005-03-11 15:55:42.002949472 -0800
   1.108 +@@ -411,7 +411,8 @@
   1.109 + 	  }								      \
   1.110 +       }									      \
   1.111 + 									      \
   1.112 +-    *((uint32_t *) outptr)++ = ch;					      \
   1.113 ++    *((uint32_t *) outptr) = ch;					      \
   1.114 ++    outptr += sizeof (uint32_t);					      \
   1.115 +   }
   1.116 + #define EXTRA_LOOP_DECLS	, int *setp
   1.117 + #define INIT_PARAMS		int set = (*setp >> 3) & CURRENT_MASK; \