From 33ea80a48bfc48263e3cc855e7a4bfef7ebe8d98 Mon Sep 17 00:00:00 2001 From: solar Date: Fri, 5 Dec 2003 04:37:27 +0000 Subject: [PATCH] Moved shared defines and typedefs to individual files. --- includes/__NULL.h | 16 ++++++++++++++++ includes/__WCHAR.h | 16 ++++++++++++++++ includes/__size_t.h | 16 ++++++++++++++++ includes/__tm.h | 15 +++++++++++++++ includes/__wchar_t.h | 15 +++++++++++++++ includes/__wint_t.h | 15 +++++++++++++++ includes/locale.h | 2 +- includes/stddef.h | 11 +++++------ includes/stdio.h | 5 ++++- includes/stdlib.h | 10 ++++------ includes/string.h | 4 ++-- includes/time.h | 8 +++++--- includes/wchar.h | 16 ++++++++-------- includes/wctype.h | 3 ++- personalities/__personality.h | Bin 1442 -> 1599 bytes personalities/stdint.h | 3 +-- 16 files changed, 125 insertions(+), 30 deletions(-) create mode 100644 includes/__NULL.h create mode 100644 includes/__WCHAR.h create mode 100644 includes/__size_t.h create mode 100644 includes/__tm.h create mode 100644 includes/__wchar_t.h create mode 100644 includes/__wint_t.h diff --git a/includes/__NULL.h b/includes/__NULL.h new file mode 100644 index 0000000..7c8cc77 --- /dev/null +++ b/includes/__NULL.h @@ -0,0 +1,16 @@ +// ---------------------------------------------------------------------------- +// $Id$ +// ---------------------------------------------------------------------------- +// Public Domain C Library - http://pdclib.sourceforge.net +// This code is Public Domain. Use, modify, and redistribute at will. +// ---------------------------------------------------------------------------- +// Definition of NULL shared by locale.h, stddef.h, stdio.h, stdlib.h, +// string.h, wchar.h, and time.h +// ---------------------------------------------------------------------------- + +#ifndef __NULL_H +#define __NULL_H __NULL_H + +#define NULL 0 + +#endif // __NULL_H diff --git a/includes/__WCHAR.h b/includes/__WCHAR.h new file mode 100644 index 0000000..cb1a181 --- /dev/null +++ b/includes/__WCHAR.h @@ -0,0 +1,16 @@ +// ---------------------------------------------------------------------------- +// $Id$ +// ---------------------------------------------------------------------------- +// Public Domain C Library - http://pdclib.sourceforge.net +// This code is Public Domain. Use, modify, and redistribute at will. +// ---------------------------------------------------------------------------- +// Definition of WCHAR_MIN and WCHAR_MAX, shared by stdint.h and wchar.h +// ---------------------------------------------------------------------------- + +#ifndef __WCHAR_H +#define __WCHAR_H __WCHAR_H + +#define WCHAR_MIN // TODO - personality? +#define WCHAR_MAX // TODO - personality? + +#endif // __WCHAR_H diff --git a/includes/__size_t.h b/includes/__size_t.h new file mode 100644 index 0000000..50d7d33 --- /dev/null +++ b/includes/__size_t.h @@ -0,0 +1,16 @@ +// ---------------------------------------------------------------------------- +// $Id$ +// ---------------------------------------------------------------------------- +// Public Domain C Library - http://pdclib.sourceforge.net +// This code is Public Domain. Use, modify, and redistribute at will. +// ---------------------------------------------------------------------------- +// size_t typedef shared by stddef.h, stdio.h, stdlib.h, string.h, time.h, and +// wchar.h +// ---------------------------------------------------------------------------- + +#ifndef __SIZE_T_H +#define __SIZE_T_H __SIZE_T_H + +typedef size_t; // TODO - personality? + +#endif // __SIZE_T_H diff --git a/includes/__tm.h b/includes/__tm.h new file mode 100644 index 0000000..7b6aaaa --- /dev/null +++ b/includes/__tm.h @@ -0,0 +1,15 @@ +// ---------------------------------------------------------------------------- +// $Id$ +// ---------------------------------------------------------------------------- +// Public Domain C Library - http://pdclib.sourceforge.net +// This code is Public Domain. Use, modify, and redistribute at will. +// ---------------------------------------------------------------------------- +// struct tm definition shared by time.h and wchar.h +// ---------------------------------------------------------------------------- + +#ifndef __TM_H +#define __TM_H __TM_H + +struct tm; // TODO - personality? + +#endif // __TM_H diff --git a/includes/__wchar_t.h b/includes/__wchar_t.h new file mode 100644 index 0000000..029cb2e --- /dev/null +++ b/includes/__wchar_t.h @@ -0,0 +1,15 @@ +// ---------------------------------------------------------------------------- +// $Id$ +// ---------------------------------------------------------------------------- +// Public Domain C Library - http://pdclib.sourceforge.net +// This code is Public Domain. Use, modify, and redistribute at will. +// ---------------------------------------------------------------------------- +// wchar_t typedef shared by stddef.h, stdlib.h, and wchar.h +// ---------------------------------------------------------------------------- + +#ifndef __WCHAR_T_H +#define __WCHAR_T_H __WCHAR_T_H + +typedef wchar_t; // TODO - personality? + +#endif // __WCHAR_T_H diff --git a/includes/__wint_t.h b/includes/__wint_t.h new file mode 100644 index 0000000..38c8457 --- /dev/null +++ b/includes/__wint_t.h @@ -0,0 +1,15 @@ +// ---------------------------------------------------------------------------- +// $Id$ +// ---------------------------------------------------------------------------- +// Public Domain C Library - http://pdclib.sourceforge.net +// This code is Public Domain. Use, modify, and redistribute at will. +// ---------------------------------------------------------------------------- +// wint_t typedef shared by wchar.h and wctype.h +// ---------------------------------------------------------------------------- + +#ifndef __WINT_T_H +#define __WINT_T_H __WINT_T_H + +typedef wint_t; // TODO - personality? + +#endif // __WINT_T_H diff --git a/includes/locale.h b/includes/locale.h index 59fd642..566fa5d 100644 --- a/includes/locale.h +++ b/includes/locale.h @@ -13,7 +13,7 @@ // ---------------------------------------------------------------------------- // DEFINES -#define NULL 0 +#include "__NULL.h" // Locale categories #define LC_COLLATE 1 // affects strcoll() and strxfrm() diff --git a/includes/stddef.h b/includes/stddef.h index 1c138c7..3c6955b 100644 --- a/includes/stddef.h +++ b/includes/stddef.h @@ -15,17 +15,16 @@ // ---------------------------------------------------------------------------- // MACROS -#define NULL 0 +#include "__NULL.h" + #define offsetof( s-type, mbr ) // TODO - personality? // ---------------------------------------------------------------------------- // TYPEDEFS -typedef ptrdiff_t; // TODO - personality? -typedef size_t; // TODO - personality? +#include "__size_t.h" +#include "__wchar_t.h" -#ifndef __cplusplus -typedef wchar_t; // TODO - personality? -#endif // __cplusplus +typedef ptrdiff_t; // TODO - personality? #endif // __STDDEF_H diff --git a/includes/stdio.h b/includes/stdio.h index a4049eb..e9d323c 100644 --- a/includes/stdio.h +++ b/includes/stdio.h @@ -15,6 +15,8 @@ // ---------------------------------------------------------------------------- // MACROS +#include "__NULL.h" + #define _IOFBF // TODO #define _IOLBF // TODO #define _IONBF // TODO @@ -23,7 +25,6 @@ #define FILENAME_MAX // TODO #define FOPEN_MAX // TODO #define L_tmpnam // TODO -#define NULL 0 #define SEEK_CUR // TODO #define SEEK_END // TODO #define SEEK_SET // TODO @@ -36,6 +37,8 @@ // ---------------------------------------------------------------------------- // TYPEDEFS +#include "__size_t.h" + typedef FILE; // TODO - personality? typedef fpos_t; // TODO - personality? typedef size_t; // TODO - personality? diff --git a/includes/stdlib.h b/includes/stdlib.h index fab8a40..500060c 100644 --- a/includes/stdlib.h +++ b/includes/stdlib.h @@ -15,10 +15,11 @@ // ---------------------------------------------------------------------------- // MACROS +#include "__NULL.h" + #define EXIT_FAILURE // TODO #define EXIT_SUCCESS // TODO #define MB_CUR_MAX // TODO -#define NULL 0 #define RAND_MAX // TODO // ---------------------------------------------------------------------------- @@ -41,11 +42,8 @@ typedef struct long long remainder; } lldiv_t; -typedef size_t; // TODO - personality? - -#ifndef __cplusplus -typedef wchar_t; // TODO - personality? -#endif // __cplusplus +#include "__size_t.h" +#include "__wchar_t.h" // ---------------------------------------------------------------------------- // FUNCTIONS diff --git a/includes/string.h b/includes/string.h index a5e5b21..55b94f9 100644 --- a/includes/string.h +++ b/includes/string.h @@ -15,12 +15,12 @@ // ---------------------------------------------------------------------------- // MACROS -#define NULL 0 +#include "__NULL.h" // ---------------------------------------------------------------------------- // TYPEDEFS -typedef size_t; // TODO - personality? +#include "__size_t.h" // ---------------------------------------------------------------------------- // FUNCTIONS diff --git a/includes/time.h b/includes/time.h index bc5742c..c527cc3 100644 --- a/includes/time.h +++ b/includes/time.h @@ -15,16 +15,18 @@ // ---------------------------------------------------------------------------- // MACROS +#include "__NULL.h" + #define CLOCKS_PER_SEC // TODO - personality? -#define NULL 0 // ---------------------------------------------------------------------------- // TYPES +#include "__size_t.h" +#include "__tm.h" + typedef clock_t; // TODO - personality? -typedef size_t; // TODO - personality? typedef time_t; // TODO - personality? -struct tm; // TODO - personality? // ---------------------------------------------------------------------------- // FUNCTIONS diff --git a/includes/wchar.h b/includes/wchar.h index a86a6fa..2af2155 100644 --- a/includes/wchar.h +++ b/includes/wchar.h @@ -15,22 +15,22 @@ // ---------------------------------------------------------------------------- // MACROS -#define NULL 0 -#define WCHAR_MAX // TODO - personality? -#define WCHAR_MIN // TODO - personality? +#include "__NULL.h" +#include "__WCHAR.h" + #define WEOF // TODO - personality? // ---------------------------------------------------------------------------- // TYPEDEFS +#include "__tm.h" +#include "__size_t.h" +#include "__wchar_t.h" +#include "__wint_t.h" + typedef mbstate_t; // TODO - personality? typedef size_t; // TODO - personality? typedef wint_t; // TODO - personality? -struct tm; // TODO - personality? - -#ifndef __cplusplus -typedef wchar_t; // TODO - personality? -#endif // __cplusplus // ---------------------------------------------------------------------------- // FUNCTIONS diff --git a/includes/wctype.h b/includes/wctype.h index 1c50bfc..6401284 100644 --- a/includes/wctype.h +++ b/includes/wctype.h @@ -15,9 +15,10 @@ // ---------------------------------------------------------------------------- // TYPEDEFS +#include "__wint_t.h" + typedef wctrans_t; // TODO - personality? typedef wctype_t; // TODO - personality? -typedef wint_t; // TODO - personality? // ---------------------------------------------------------------------------- // FUNCTIONS diff --git a/personalities/__personality.h b/personalities/__personality.h index bf2d2a6194a3ce868e9e39de505ebd567f04dcc9..f769b4aa2fb357b08361a2c0dbe8de822ad59c31 100644 GIT binary patch delta 161 zcmZ3)y`N{pBgV}S8P%BULozap6^cuWN|Q@Ui&7PUoTAji(#)dN6osTpg_6wNRJ{y^ z#Jm)R^5l%fBE1Z~n1aM2E{Fz&l3Z&r7fk5uD}W6vsVu-S2dWur5J&~oBmpiECnYsa Qp*%CMB)-IY@-LPZ0JFI|*Z=?k delta 16 Ycmdnbvxs}cBgV~-8C97lFJYYx06S9#q5uE@ diff --git a/personalities/stdint.h b/personalities/stdint.h index 4b2a757..d92753a 100644 --- a/personalities/stdint.h +++ b/personalities/stdint.h @@ -129,8 +129,7 @@ typedef uintmax_t; // TODO #define WCHAR_MIN // TODO #define WCHAR_MAX // TODO -#define WINT_MIN // TODO -#define WINT_MAX // TODO +#include "__WCHAR.h" #define INTMAX_MIN // TODO #define INTMAX_MAX // TODO -- 2.40.0