Avoid duplicate type definitions, especially wchar_t which was inconsstent and caused trouble in libarchive

This commit is contained in:
Erik van der Kouwe 2010-08-23 17:00:04 +00:00
parent a2647a4181
commit 3211be5d14
4 changed files with 5 additions and 39 deletions

View file

@ -7,6 +7,7 @@
#include <ansi.h> #include <ansi.h>
#endif #endif
#include <stddef.h>
#include <sys/null.h> #include <sys/null.h>
#define EXIT_FAILURE 1 /* standard error return using exit() */ #define EXIT_FAILURE 1 /* standard error return using exit() */
@ -17,16 +18,7 @@
typedef struct { int quot, rem; } div_t; typedef struct { int quot, rem; } div_t;
typedef struct { long quot, rem; } ldiv_t; typedef struct { long quot, rem; } ldiv_t;
/* The types are size_t, wchar_t, div_t, and ldiv_t. */ /* The types are div_t, and ldiv_t. */
#ifndef _SIZE_T
#define _SIZE_T
typedef unsigned int size_t; /* type returned by sizeof */
#endif
#ifndef _WCHAR_T
#define _WCHAR_T
typedef char wchar_t; /* type expanded character set */
#endif
/* Function Prototypes. */ /* Function Prototypes. */
_PROTOTYPE( void abort, (void) ); _PROTOTYPE( void abort, (void) );

View file

@ -58,6 +58,7 @@
#include <ansi.h> #include <ansi.h>
#include <stdarg.h> #include <stdarg.h>
#include <stddef.h>
#include <stdio.h> /* for FILE* */ #include <stdio.h> /* for FILE* */
@ -70,11 +71,6 @@ typedef union {
char __mbstate8[128]; char __mbstate8[128];
} __mbstate_t; } __mbstate_t;
#ifndef _WCHAR_T
#define _WCHAR_T
typedef int wchar_t;
#endif
#ifndef _MBSTATE_T #ifndef _MBSTATE_T
#define _MBSTATE_T #define _MBSTATE_T
typedef __mbstate_t mbstate_t; typedef __mbstate_t mbstate_t;
@ -87,11 +83,6 @@ typedef int wint_t;
#endif #endif
#ifndef _SIZE_T
#define _SIZE_T
typedef unsigned int size_t; /* type returned by sizeof */
#endif
struct tm; struct tm;
#ifdef __ACK__ #ifdef __ACK__

View file

@ -30,29 +30,14 @@
#define _WCTYPE_H_ #define _WCTYPE_H_
#include <ansi.h> #include <ansi.h>
#include <stddef.h>
#ifndef _WCHAR_T #include <wchar.h>
#define _WCHAR_T
typedef int wchar_t;
#endif
#ifndef _WCTYPE_T #ifndef _WCTYPE_T
#define _WCTYPE_T #define _WCTYPE_T
typedef void *wctype_t; typedef void *wctype_t;
#endif #endif
#ifndef _WINT_T
#define _WINT_T
typedef int wint_t;
#endif
#ifndef _SIZE_T
#define _SIZE_T
typedef unsigned int size_t; /* type returned by sizeof */
#endif
#ifndef _WCTRANS_T #ifndef _WCTRANS_T
#define _WCTRANS_T #define _WCTRANS_T
typedef void *wctrans_t; typedef void *wctrans_t;

View file

@ -62,8 +62,6 @@
#define END_OF_FILE (-104) /* eof detected */ #define END_OF_FILE (-104) /* eof detected */
#define offsetof(type, field) ((size_t)(&((type *)0)->field))
/* Miscellaneous constants */ /* Miscellaneous constants */
#define SYS_UID ((uid_t) 0) /* uid_t for processes PM and INIT */ #define SYS_UID ((uid_t) 0) /* uid_t for processes PM and INIT */
#define SYS_GID ((gid_t) 0) /* gid_t for processes PM and INIT */ #define SYS_GID ((gid_t) 0) /* gid_t for processes PM and INIT */