]> pd.if.org Git - pdclib/commitdiff
Cosmetics (moving Id tag to top, adding Name tag, adjusting limits.h from enquire...
authorsolar <unknown>
Wed, 8 Dec 2004 19:51:15 +0000 (19:51 +0000)
committersolar <unknown>
Wed, 8 Dec 2004 19:51:15 +0000 (19:51 +0000)
_PDCLIB_config.h
_PDCLIB_int.h
float.h
iso646.h
limits.h
stdarg.h
stdbool.h
stddef.h
stdint.h

index 95855056f28e3d0f4d1f2cbc0f4d319e04e12986..2b69f07c121805e1a2c3d85ed8d7d95029e595c1 100644 (file)
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/* Release: $Name$ */
+
 /* Internal PDCLib configuration <_PDCLIB_config.h>
    (Generic Template)
 
@@ -10,7 +12,7 @@
 /* -------------------------------------------------------------------------- */
 /* Integers                                                                   */
 /* -------------------------------------------------------------------------- */
-/* Assuming 8-bit char, two's-complement architecture here, 'short' being     */
+/* Assuming 8-bit char, two's-complement architecture here. 'short' being     */
 /* either 8 or 16 bit, 'int' being either 16, 32 or 64 bit, 'long' being      */
 /* either 32 or 64 bit, and 'long long' being 64 bit if 'long' is not, 64 or  */
 /* 128 bit otherwise.                                                         */
@@ -77,8 +79,8 @@ typedef int             _PDCLIB_ptrdiff_t;
 #define _PDCLIB_SIG_ATOMIC INT
 
 /* Result type of the 'sizeof' operator */
-#define _PDCLIB_SIZE UINT
 typedef unsigned int _PDCLIB_size_t;
+#define _PDCLIB_SIZE UINT
 
 /* Large enough an integer to hold all character codes of the largest supported
    locale.
index af65596f89b49876eed8d39c42232eeb8d32d594..7f780f6c226d46ff48c76f44dbbe72d1db2a9fe6 100644 (file)
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/* Release: $Name$ */
+
 /* Internal PDCLib logic <_PDCLIB_internal.h>
 
    This file is part of the Public Domain C Library (PDCLib).
 
 /* -------------------------------------------------------------------------- */
 /* You should not have to edit anything in this file; if you DO have to, it   */
-/* would be considered a bug / missing feature: notify the author.            */
+/* would be considered a bug / missing feature: notify the author(s).         */
 /* -------------------------------------------------------------------------- */
 
+#ifndef _PDCLIB_CONFIG_H
+#define _PDCLIB_CONFIG_H _PDCLIB_CONFIG_H
 #include <_PDCLIB_config.h>
+#endif
 
 /* null pointer constant */
 #define _PDCLIB_NULL 0
@@ -22,7 +27,7 @@
 /* _PDCLIB_concat( x, y ) concatenates two preprocessor tokens with extending */
 /* -------------------------------------------------------------------------- */
 
-#define _PDCLIB_cc( x, y ) x ## y
+#define _PDCLIB_cc( x, y )     x ## y
 #define _PDCLIB_concat( x, y ) _PDCLIB_cc( x, y )
 
 /* -------------------------------------------------------------------------- */
@@ -238,7 +243,7 @@ typedef unsigned _PDCLIB_fast64 _PDCLIB_uint_fast64_t;
 #define _PDCLIB_UINT64_LITERAL ull
 
 /* -------------------------------------------------------------------------- */
-/* <stdint.h> "fast" typedefs                                                 */
+/* <stdint.h> intptr and intmax typedefs and limits                           */
 /* -------------------------------------------------------------------------- */
 
 typedef int                 _PDCLIB_intptr_t;
diff --git a/float.h b/float.h
index 7382c3f1673419c1040e6ff67d68591833bbc7a8..40e20006990cd250e77ff629c98efc66b0e748f4 100644 (file)
--- a/float.h
+++ b/float.h
@@ -1,22 +1,24 @@
-#ifndef _PDCLIB_FLOAT_H
-#define _PDCLIB_FLOAT_H _PDCLIB_FLOAT_H
-
 /* $Id$ */
 
+/* Release: $Name$ */
+
 /* 7.7 Characteristics of floating types <float.h>
 
    This file is part of the Public Domain C Library (PDCLib).
    Permission is granted to use, modify, and / or redistribute at will.
 */
 
-#ifndef _PDCLIB_DEFS_H
-#define _PDCLIB_DEFS_H _PDCLIB_DEFS_H
-#include <_PDCLIB_defs.h>
+#ifndef _PDCLIB_FLOAT_H
+#define _PDCLIB_FLOAT_H _PDCLIB_FLOAT_H
+
+#ifndef _PDCLIB_CONFIG_H
+#define _PDCLIB_CONFIG_H _PDCLIB_CONFIG_H
+#include <_PDCLIB_config.h>
 #endif
 
-#define FLT_ROUNDS _PDCLIB_FLT_ROUNDS
+#define FLT_ROUNDS      _PDCLIB_FLT_ROUNDS
 #define FLT_EVAL_METHOD _PDCLIB_FLT_EVAL_METHOD
-#define DECIMAL_DIG _PDCLIB_DECIMAL_DIG
+#define DECIMAL_DIG     _PDCLIB_DECIMAL_DIG
 
 /* Produced by enquire version 5.1a, CWI, Amsterdam
    http://www.cwi.nl/~steven/enquire.html  */
index 33ff8971f19458082525cd4560e9720d830e5a9b..a25af3d16f94380d757994585eda7c6aeb9a2481 100644 (file)
--- a/iso646.h
+++ b/iso646.h
@@ -1,14 +1,16 @@
-#ifndef _PDCLIB_ISO646_H
-#define _PDCLIB_ISO646_H _PDCLIB_ISO646_H
-
 /* $Id$ */
 
+/* Release: $Name$ */
+
 /* 7.9 Alternative spellings <iso646.h> */
 
    This file is part of the Public Domain C Library (PDCLib).
    Permission is granted to use, modify, and / or redistribute at will.
 */
 
+#ifndef _PDCLIB_ISO646_H
+#define _PDCLIB_ISO646_H _PDCLIB_ISO646_H
+
 #define and &&
 #define and_eq &=
 #define bitand &
index 65cdae7310982f68cdd8a210fa0218a26e1acedf..1dfb7908e6b318a119901abbb57cc61d2af12751 100644 (file)
--- a/limits.h
+++ b/limits.h
@@ -1,53 +1,42 @@
-#ifndef _PDCLIB_LIMITS_H
-#define _PDCLIB_LIMITS_H _PDCLIB_LIMITS_H
-
 /* $Id$ */
 
+/* Release: $Name$ */
+
 /* 7.10 Sizes of integer types <limits.h>
 
    This file is part of the Public Domain C Library (PDCLib).
    Permission is granted to use, modify, and / or redistribute at will.
 */
 
-/* Defined to 1 as multibyte characters are not supported yet. */
+#ifndef _PDCLIB_LIMITS_H
+#define _PDCLIB_LIMITS_H _PDCLIB_LIMITS_H
+
+#ifndef _PDCLIB_INT_H
+#define _PDCLIB_INT_H _PDCLIB_INT_H
+#include <_PDCLIB_int.h>
+#endif
+
+/* TODO: Defined to 1 as multibyte characters are not supported yet. */
 #define MB_LEN_MAX 1
 
-#define LLONG_MIN  (-0x7fffffffffffffff - 1)
-#define LLONG_MAX  0x7fffffffffffffff
-#define ULLONG_MAX 0xffffffffffffffff
-
-/* Produced by enquire version 5.1a, CWI, Amsterdam
-   http://www.cwi.nl/~steven/enquire.html  */
-
-   /* Number of bits in a storage unit */
-#define CHAR_BIT 8
-   /* Maximum char */
-#define CHAR_MAX 127
-   /* Minimum char */
-#define CHAR_MIN (-128)
-   /* Maximum signed char */
-#define SCHAR_MAX 127
-   /* Minimum signed char */
-#define SCHAR_MIN (-128)
-   /* Maximum unsigned char (minimum is always 0) */
-#define UCHAR_MAX 255
-   /* Maximum short */
-#define SHRT_MAX 32767
-   /* Minimum short */
-#define SHRT_MIN (-32768)
-   /* Maximum int */
-#define INT_MAX 2147483647
-   /* Minimum int */
-#define INT_MIN (-2147483647-1)
-   /* Maximum long */
-#define LONG_MAX 2147483647L
-   /* Minimum long */
-#define LONG_MIN (-2147483647L-1L)
-   /* Maximum unsigned short (minimum is always 0) */
-#define USHRT_MAX 65535
-   /* Maximum unsigned int (minimum is always 0) */
-#define UINT_MAX 4294967295U
-   /* Maximum unsigned long (minimum is always 0) */
-#define ULONG_MAX 4294967295UL
+#define LLONG_MIN  _PDCLIB_LLONG_MIN
+#define LLONG_MAX  _PDCLIB_LLONG_MAX
+#define ULLONG_MAX _PDCLIB_ULLONG_MAX
+
+#define CHAR_BIT   _PDCLIB_CHAR_BIT
+#define CHAR_MAX   _PDCLIB_CHAR_MAX
+#define CHAR_MIN   _PDCLIB_CHAR_MIN
+#define SCHAR_MAX  _PDCLIB_SCHAR_MAX
+#define SCHAR_MIN  _PDCLIB_SCHAR_MIN
+#define UCHAR_MAX  _PDCLIB_UCHAR_MAX
+#define SHRT_MAX   _PDCLIB_SHRT_MAX
+#define SHRT_MIN   _PDCLIB_SHRT_MIN
+#define INT_MAX    _PDCLIB_INT_MAX
+#define INT_MIN    _PDCLIB_INT_MIN
+#define LONG_MAX   _PDCLIB_LONG_MAX
+#define LONG_MIN   _PDCLIB_LONG_MIN
+#define USHRT_MAX  _PDCLIB_USHRT_MAX
+#define UINT_MAX   _PDCLIB_UINT_MAX
+#define ULONG_MAX  _PDCLIB_ULONG_MAX
 
 #endif
index 44ad5ac7b5efed6edfd1ad0c682154161b0cf5fb..cb74be2258ba861267d0bdf1d0868f90e1bcfdb9 100644 (file)
--- a/stdarg.h
+++ b/stdarg.h
@@ -1,17 +1,19 @@
-#ifndef _PDCLIB_STDARG_H
-#define _PDCLIB_STDARG_H _PDCLIB_STDARG_H
-
 /* $Id$ */
 
+/* Release: $Name$ */
+
 /* 7.15 Variable arguments <stdarg.h> 
 
    This file is part of the Public Domain C Library (PDCLib).
    Permission is granted to use, modify, and / or redistribute at will.
 */
 
-#ifndef _PDCLIB_DEFS_H
-#define _PDCLIB_DEFS_H _PDCLIB_DEFS_H
-#include <_PDCLIB_defs.h>
+#ifndef _PDCLIB_STDARG_H
+#define _PDCLIB_STDARG_H _PDCLIB_STDARG_H
+
+#ifndef _PDCLIB_CONFIG_H
+#define _PDCLIB_CONFIG_H _PDCLIB_CONFIG_H
+#include <_PDCLIB_config.h>
 #endif
 
 typedef _PDCLIB_va_list va_list;
index dc93679f183c247a271eba07cde2c4624f3bdb41..8e9b7e316a00dac97900946f359a72af04e01643 100644 (file)
--- a/stdbool.h
+++ b/stdbool.h
@@ -1,17 +1,19 @@
-#ifndef _PDCLIB_STDBOOL_H
-#define _PDCLIB_STDBOOL_H _PDCLIB_STDBOOL_H
-
 /* $Id$ */
 
+/* Release: $Name$ */
+
 /* 7.16 Boolean type and values <stdbool.h>
 
    This file is part of the Public Domain C Library (PDCLib).
    Permission is granted to use, modify, and / or redistribute at will.
 */
 
-#define bool _Bool
-#define true 1
-#define false 0
+#ifndef _PDCLIB_STDBOOL_H
+#define _PDCLIB_STDBOOL_H _PDCLIB_STDBOOL_H
+
+#define bool                          _Bool
+#define true                          1
+#define false                         0
 #define __bool_true_false_are_defined 1
 
 #endif
index babb365cee1b375dd47581e42b2ea2065ec1fc54..b3e848a0e10cc1854870f2f0652189f676b580b4 100644 (file)
--- a/stddef.h
+++ b/stddef.h
@@ -1,17 +1,19 @@
-#ifndef _PDCLIB_STDDEF_H
-#define _PDCLIB_STDDEF_H _PDCLIB_STDDEF_H
-
 /* $Id$ */
 
+/* Release: $Name$ */
+
 /* 7.17 Common definitions <stddef.h>
 
    This file is part of the Public Domain C Library (PDCLib).
    Permission is granted to use, modify, and / or redistribute at will.
 */
 
-#ifndef _PDCLIB_DEFS_H
-#define _PDCLIB_DEFS_H _PDCLIB_DEFS_H
-#include <_PDCLIB_defs.h>
+#ifndef _PDCLIB_STDDEF_H
+#define _PDCLIB_STDDEF_H _PDCLIB_STDDEF_H
+
+#ifndef _PDCLIB_CONFIG_H
+#define _PDCLIB_CONFIG_H _PDCLIB_CONFIG_H
+#include <_PDCLIB_config.h>
 #endif
 
 typedef _PDCLIB_ptrdiff_t ptrdiff_t;
index d126bcf0a90d6ac4019ef090c937335e84f8caac..1f0ebd4a78db5d7b4c4a5738dc67d1472fbe019c 100644 (file)
--- a/stdint.h
+++ b/stdint.h
@@ -1,17 +1,19 @@
-#ifndef _PDCLIB_STDINT_H
-#define _PDCLIB_STDINT_H _PDCLIB_STDINT_H
-
 /* $Id$ */
 
+/* Release: $Name$ */
+
 /* 7.18 Integer types <stdint.h>
 
    This file is part of the Public Domain C Library (PDCLib).
    Permission is granted to use, modify, and / or redistribute at will.
 */
 
-#ifndef _PDCLIB_DEFS_H
-#define _PDCLIB_DEFS_H _PDCLIB_DEFS_H
-#include <_PDCLIB_defs.h>
+#ifndef _PDCLIB_STDINT_H
+#define _PDCLIB_STDINT_H _PDCLIB_STDINT_H
+
+#ifndef _PDCLIB_INT_H
+#define _PDCLIB_INT_H _PDCLIB_INT_H
+#include <_PDCLIB_int.h>
 #endif
 
 /* 7.18.1.1 Exact-width integer types. */
@@ -28,6 +30,11 @@ typedef _PDCLIB_uint64_t uint64_t;
 
 /* 7.18.1.2 Minimum-width integer types */
 
+/* You are allowed to add more types here, e.g. int_least24_t. For the standard
+   types, int_leastN_t is equivalent to the corresponding exact type intN_t by
+   definition.
+*/
+
 typedef int8_t  int_least8_t;
 typedef int16_t int_least16_t;
 typedef int32_t int_least32_t;
@@ -74,25 +81,27 @@ typedef _PDCLIB_uintmax_t uintmax_t;
 
 /* 7.18.2.1 Limits of exact-width integer types */
 
-#define INT8_MIN (-0x7f - 1)
-#define INT8_MAX   0x7f
-#define UINT8_MAX  0xff
+#define INT8_MIN  _PDCLIB_INT8_MIN
+#define INT8_MAX  _PDCLIB_INT8_MAX
+#define UINT8_MAX _PDCLIB_UINT8_MAX
 
-#define INT16_MIN (-0x7fff - 1)
-#define INT16_MAX   0x7fff
-#define UINT16_MAX  0xffff
+#define INT16_MIN  _PDCLIB_INT16_MIN
+#define INT16_MAX  _PDCLIB_INT16_MAX
+#define UINT16_MAX _PDCLIB_UINT16_MAX
 
-#define INT32_MIN (-0x7fffffff - 1)
-#define INT32_MAX   0x7fffffff
-#define UINT32_MAX  0xffffffff
+#define INT32_MIN  _PDCLIB_INT32_MIN
+#define INT32_MAX  _PDCLIB_INT32_MAX
+#define UINT32_MAX _PDCLIB_UINT32_MAX
 
-#define INT64_MIN (-0x7fffffffffffffff - 1)
-#define INT64_MAX   0x7fffffffffffffff
-#define UINT64_MAX  0xffffffffffffffff
+#define INT64_MIN  _PDCLIB_INT64_MIN
+#define INT64_MAX  _PDCLIB_INT64_MAX
+#define UINT64_MAX _PDCLIB_UINT64_MAX
 
 /* 7.18.2.2 Limits of minimum-width integer types */
 
-/* See the comment at 7.18.1.2 as to type equivalence. */
+/* For the standard widths, least and exact types are equivalent.
+   You are allowed to add more types here, e.g. int_least24_t.
+*/
 
 #define INT_LEAST8_MIN  INT8_MIN
 #define INT_LEAST8_MAX  INT8_MAX
@@ -171,24 +180,26 @@ typedef _PDCLIB_uintmax_t uintmax_t;
 /* 7.18.4.1 Macros for minimum-width integer constants */
 
 /* Expand to an integer constant of specified value and type int_leastN_t */
-#define INT8_C( value )  _PDCLIB_append( value, _PDCLIB_INT8_LITERAL )
-#define INT16_C( value ) _PDCLIB_append( value, _PDCLIB_INT16_LITERAL )
-#define INT32_C( value ) _PDCLIB_append( value, _PDCLIB_INT32_LITERAL )
-#define INT64_C( value ) _PDCLIB_append( value, _PDCLIB_INT64_LITERAL )
+
+#define INT8_C( value )  _PDCLIB_concat( value, _PDCLIB_INT8_LITERAL )
+#define INT16_C( value ) _PDCLIB_concat( value, _PDCLIB_INT16_LITERAL )
+#define INT32_C( value ) _PDCLIB_concat( value, _PDCLIB_INT32_LITERAL )
+#define INT64_C( value ) _PDCLIB_concat( value, _PDCLIB_INT64_LITERAL )
 
 /* Expand to an integer constant of specified value and type uint_leastN_t */
-#define UINT8_C( value )  _PDCLIB_append( value, _PDCLIB_UINT8_LITERAL )
-#define UINT16_C( value ) _PDCLIB_append( value, _PDCLIB_UINT16_LITERAL )
-#define UINT32_C( value ) _PDCLIB_append( value, _PDCLIB_UINT32_LITERAL )
-#define UINT64_C( value ) _PDCLIB_append( value, _PDCLIB_UINT64_LITERAL )
+
+#define UINT8_C( value )  _PDCLIB_concat( value, _PDCLIB_UINT8_LITERAL )
+#define UINT16_C( value ) _PDCLIB_concat( value, _PDCLIB_UINT16_LITERAL )
+#define UINT32_C( value ) _PDCLIB_concat( value, _PDCLIB_UINT32_LITERAL )
+#define UINT64_C( value ) _PDCLIB_concat( value, _PDCLIB_UINT64_LITERAL )
 
 /* 7.18.4.2 Macros for greatest-width integer constants */
 
 /* Expand to an integer constant of specified value and type intmax_t */
-#define INTMAX_C( value )  _PDCLIB_append( value, _PDCLIB_INTMAX_LITERAL )
+#define INTMAX_C( value )  _PDCLIB_concat( value, _PDCLIB_INTMAX_LITERAL )
 
 /* Expand to an integer constant of specified value and type uintmax_t */
-#define UINTMAX_C( value ) _PDCLIB_append( value, _PDCLIB_UINTMAX_LITERAL )
+#define UINTMAX_C( value ) _PDCLIB_concat( value, _PDCLIB_UINTMAX_LITERAL )
 
 #endif