89 lines
2.8 KiB

# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../dietlibc/stdint.patch
# Copyright (C) 2007 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- ./include/stdint.h.orig 2007-07-18 19:35:47.000000000 -0400
+++ ./include/stdint.h 2007-07-18 19:51:06.000000000 -0400
@@ -26,28 +26,6 @@
typedef uint64_t uint_fast64_t;
-
-/* The ISO C99 standard specifies that in C++ implementations these
- should only be defined if explicitly requested. */
-#if !defined __cplusplus || defined __STDC_LIMIT_MACROS
-
-/* FIXME: missing are
- INTx_MIN, INTx_MAX, UINTx_MAX
- INT_LEASTx_MIN, INT_LEASTx_MAX, UINT_LEASTx_MAX
- INT_FASTx_MIN, INT_FASTx_MAX, UINT_FASTx_MAX
- INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX
- INTPTR_MIN, INTPTR_MAX, UINTPTR_MAX
- PTRDIFF_MIN, PTRDIFF_MAX
- SIG_ATOMIC_MIN, SIG_ATOMIC_MAX
- SIZE_MAX
- WCHAR_MIN, WCHAR_MAX
- WINT_MIN, WINT_MAX
-*/
-
-#endif /* C++ && limit macros */
-
-
-
/* The ISO C99 standard specifies that in C++ implementations these
should only be defined if explicitly requested. */
#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
@@ -83,6 +61,41 @@
#endif /* C++ && constant macros */
+/* The ISO C99 standard specifies that in C++ implementations these
+ should only be defined if explicitly requested. */
+#if !defined __cplusplus || defined __STDC_LIMIT_MACROS
+
+/* Minimum of signed integral types. */
+# define INT8_MIN (-128)
+# define INT16_MIN (-32767-1)
+# define INT32_MIN (-2147483647-1)
+# define INT64_MIN (-INT64_C(9223372036854775807)-1)
+/* Maximum of signed integral types. */
+# define INT8_MAX (127)
+# define INT16_MAX (32767)
+# define INT32_MAX (2147483647)
+# define INT64_MAX (INT64_C(9223372036854775807))
+
+/* Maximum of unsigned integral types. */
+# define UINT8_MAX (255)
+# define UINT16_MAX (65535)
+# define UINT32_MAX (4294967295U)
+# define UINT64_MAX (UINT64_C(18446744073709551615))
+
+/* FIXME: missing are
+ INT_LEASTx_MIN, INT_LEASTx_MAX, UINT_LEASTx_MAX
+ INT_FASTx_MIN, INT_FASTx_MAX, UINT_FASTx_MAX
+ INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX
+ INTPTR_MIN, INTPTR_MAX, UINTPTR_MAX
+ PTRDIFF_MIN, PTRDIFF_MAX
+ SIG_ATOMIC_MIN, SIG_ATOMIC_MAX
+ SIZE_MAX
+ WCHAR_MIN, WCHAR_MAX
+ WINT_MIN, WINT_MAX
+*/
+
+#endif /* C++ && limit macros */
+
__END_DECLS
#endif