Fix crash of AboutSystem on gcc4.

* Glibc declares and uses its own version of mbstate_t, which is
  incompatibly with our own. Mix our own fields into glibc's
  mbstate_t, such that the two structs are compatible.
This commit is contained in:
Oliver Tappe 2011-12-19 18:45:28 +01:00
parent 4e9e029551
commit 2ba22cc36a

View File

@ -63,15 +63,26 @@ typedef unsigned int wint_t;
#ifndef __mbstate_t_defined
# define __mbstate_t_defined 1
/* Conversion state information. */
/* Conversion state information - for now a mixture between glibc's own idea of
mbstate_t and our own. */
typedef struct
{
int __count;
void* converter;
char charset[64];
union
{
wint_t __wch;
char __wchb[4];
} __value; /* Value so far. */
unsigned int count;
int __count;
};
union
{
char data[1024 + 8]; // 1024 bytes for data, 8 for alignment space
union
{
wint_t __wch;
char __wchb[4];
} __value; /* Value so far. */
};
} __mbstate_t;
#endif
#undef __need_mbstate_t