From: Erik van der Kouwe Date: Mon, 23 Aug 2010 17:00:04 +0000 (+0000) Subject: Avoid duplicate type definitions, especially wchar_t which was inconsstent and caused... X-Git-Tag: v3.1.8~54 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=3211be5d1434a6fb475ab2c0cdb0624621227c3a;p=minix.git Avoid duplicate type definitions, especially wchar_t which was inconsstent and caused trouble in libarchive --- diff --git a/include/stdlib.h b/include/stdlib.h index 3d74ee6a0..56a72f14b 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -7,6 +7,7 @@ #include #endif +#include #include #define EXIT_FAILURE 1 /* standard error return using exit() */ @@ -17,16 +18,7 @@ typedef struct { int quot, rem; } div_t; typedef struct { long quot, rem; } ldiv_t; -/* The types are size_t, wchar_t, 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 +/* The types are div_t, and ldiv_t. */ /* Function Prototypes. */ _PROTOTYPE( void abort, (void) ); diff --git a/include/wchar.h b/include/wchar.h index b40962c93..56bc15b91 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -58,6 +58,7 @@ #include #include +#include #include /* for FILE* */ @@ -70,11 +71,6 @@ typedef union { char __mbstate8[128]; } __mbstate_t; -#ifndef _WCHAR_T -#define _WCHAR_T -typedef int wchar_t; -#endif - #ifndef _MBSTATE_T #define _MBSTATE_T typedef __mbstate_t mbstate_t; @@ -87,11 +83,6 @@ typedef int wint_t; #endif -#ifndef _SIZE_T -#define _SIZE_T -typedef unsigned int size_t; /* type returned by sizeof */ -#endif - struct tm; #ifdef __ACK__ diff --git a/include/wctype.h b/include/wctype.h index eaaf0e00b..b5b78be4b 100644 --- a/include/wctype.h +++ b/include/wctype.h @@ -30,29 +30,14 @@ #define _WCTYPE_H_ #include - -#ifndef _WCHAR_T -#define _WCHAR_T -typedef int wchar_t; -#endif +#include +#include #ifndef _WCTYPE_T #define _WCTYPE_T typedef void *wctype_t; #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 #define _WCTRANS_T typedef void *wctrans_t; diff --git a/servers/iso9660fs/const.h b/servers/iso9660fs/const.h index 427da9363..f6cde1994 100644 --- a/servers/iso9660fs/const.h +++ b/servers/iso9660fs/const.h @@ -62,8 +62,6 @@ #define END_OF_FILE (-104) /* eof detected */ -#define offsetof(type, field) ((size_t)(&((type *)0)->field)) - /* Miscellaneous constants */ #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 */