summaryrefslogtreecommitdiff
path: root/com32/include/stdint.h
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-07-27 10:41:30 +0100
committerMatt Fleming <matt.fleming@intel.com>2012-07-30 09:51:36 +0100
commit0d6f330878173c7ba45b884f3e41ce40b917c73c (patch)
tree0a887066d35d8b01914330d6ab6818fe015a5a9d /com32/include/stdint.h
parent0fcd9a48603497dcc2727570a50a4401bb0fd085 (diff)
parentf0bbf9dd40f37f8c4870a33784996efd56955a75 (diff)
downloadsyslinux-0d6f330878173c7ba45b884f3e41ce40b917c73c.tar.gz
Merge remote-tracking branch 'mfleming/elflink' into for-hpa/elflink/firmware
Conflicts: Makefile com32/elflink/ldlinux/adv.c com32/elflink/ldlinux/kernel.c com32/elflink/ldlinux/ldlinux.c com32/include/bitsize/stddef.h com32/include/bitsize/stdint.h com32/include/stdint.h com32/include/sys/module.h com32/include/sys/x86_64/bitops.h com32/include/syslinux/linux.h com32/lib/Makefile com32/lib/sys/ansicon_write.c com32/lib/sys/module/elfutils.h com32/lib/sys/vesa/efi/fill.h com32/lib/syslinux/load_linux.c com32/lib/syslinux/serial.c com32/lib/syslinux/shuffle.c core/conio.c core/elflink/config.c core/elflink/load_env32.c core/graphics.c core/include/graphics.h core/init.c core/pxelinux.asm mk/elf.mk mk/lib.mk
Diffstat (limited to 'com32/include/stdint.h')
-rw-r--r--com32/include/stdint.h192
1 files changed, 66 insertions, 126 deletions
diff --git a/com32/include/stdint.h b/com32/include/stdint.h
index 0d0e8f69..f64f0278 100644
--- a/com32/include/stdint.h
+++ b/com32/include/stdint.h
@@ -5,151 +5,87 @@
#ifndef _STDINT_H
#define _STDINT_H
-/* FIXME: Move common typedefs to bitsize/stdint.h
- * and architecture specificis to bitsize32/64
- */
#include <bitsize/stdint.h>
-#if 0
-/* Exact types */
-typedef signed char int8_t;
-typedef signed short int16_t;
-typedef signed int int32_t;
-typedef signed long long int64_t;
+typedef int8_t int_least8_t;
+typedef int16_t int_least16_t;
+typedef int32_t int_least32_t;
+typedef int64_t int_least64_t;
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned int uint32_t;
-typedef unsigned long long uint64_t;
+typedef uint8_t uint_least8_t;
+typedef uint16_t uint_least16_t;
+typedef uint32_t uint_least32_t;
+typedef uint64_t uint_least64_t;
-/* Small types */
+typedef int8_t int_fast8_t;
+typedef int64_t int_fast64_t;
-typedef signed char int_least8_t;
-typedef signed short int_least16_t;
-typedef signed int int_least32_t;
-typedef signed long long int_least64_t;
+typedef uint8_t uint_fast8_t;
+typedef uint64_t uint_fast64_t;
-typedef unsigned char uint_least8_t;
-typedef unsigned short uint_least16_t;
-typedef unsigned int uint_least32_t;
-typedef unsigned long long uint_least64_t;
+typedef int64_t intmax_t;
+typedef uint64_t uintmax_t;
-/* Fast types */
+#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
-typedef signed char int_fast8_t;
-typedef signed short int_fast16_t; /* ?? 32: int 64: long */
-typedef signed int int_fast32_t; /* ?? 64: long int */
-typedef signed long long int_fast64_t; /* 64: long int */
+#define INT8_MIN (-128)
+#define INT16_MIN (-32768)
+#define INT32_MIN (-2147483647-1)
+#define INT64_MIN (__INT64_C(-9223372036854775807)-1)
-typedef unsigned char uint_fast8_t;
-typedef unsigned short uint_fast16_t; /* 32: unsigned int 64: short unsigned int */
-typedef unsigned int uint_fast32_t;
-typedef unsigned long long uint_fast64_t;/* 64: long unsigned int */
+#define INT8_MAX (127)
+#define INT16_MAX (32767)
+#define INT32_MAX (2147483647)
+#define INT64_MAX (__INT64_C(9223372036854775807))
-/* Pointer types */
+#define UINT8_MAX (255U)
+#define UINT16_MAX (65535U)
+#define UINT32_MAX (4294967295U)
+#define UINT64_MAX (__UINT64_C(18446744073709551615))
-typedef int32_t intptr_t; /* 64: long int */
-typedef uint32_t uintptr_t; /* 64: long unsigned int */
+#define INT_LEAST8_MIN INT8_MIN
+#define INT_LEAST16_MIN INT16_MIN
+#define INT_LEAST32_MIN INT32_MIN
+#define INT_LEAST64_MIN INT64_MIN
-/* Maximal types */
+#define INT_LEAST8_MAX INT8_MAX
+#define INT_LEAST16_MAX INT16_MAX
+#define INT_LEAST32_MAX INT32_MAX
+#define INT_LEAST64_MAX INT64_MAX
-typedef int64_t intmax_t;
-typedef uint64_t uintmax_t;
-#endif
-/* FIXME: move common definitions to bitsize/stdint.h and
- * architecture specifics to bitsize32/64/stdintlimits.h as appropriate
- */
-/*
- * To be strictly correct...
- */
-#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
+#define UINT_LEAST8_MAX UINT8_MAX
+#define UINT_LEAST16_MAX UINT16_MAX
+#define UINT_LEAST32_MAX UINT32_MAX
+#define UINT_LEAST64_MAX UINT64_MAX
-# define INT8_MIN (-128)
-# define INT16_MIN (-32767-1)
-# define INT32_MIN (-2147483647-1)
-# define INT64_MIN (-9223372036854775807LL-1)
-
-# define INT8_MAX (127)
-# define INT16_MAX (32767)
-# define INT32_MAX (2147483647)
-# define INT64_MAX (9223372036854775807LL)
-
-# define UINT8_MAX (255U)
-# define UINT16_MAX (65535U)
-# define UINT32_MAX (4294967295U)
-# define UINT64_MAX (18446744073709551615ULL)
-
-# define INT_LEAST8_MIN INT8_MIN //(-128)
-# define INT_LEAST16_MIN INT16_MIN //(-32767-1)
-# define INT_LEAST32_MIN INT32_MIN //(-2147483647-1)
-# define INT_LEAST64_MIN INT64_MIN //(-9223372036854775807LL-1)
-
-# define INT_LEAST8_MAX INT8_MAX //(127)
-# define INT_LEAST16_MAX INT16_MAX //(32767)
-# define INT_LEAST32_MAX INT32_MAX //(2147483647)
-# define INT_LEAST64_MAX INT64_MAX //(9223372036854775807LL)
-
-# define UINT_LEAST8_MAX UINT8_MAX //(255U)
-# define UINT_LEAST16_MAX UINT16_MAX //(65535U)
-# define UINT_LEAST32_MAX UINT32_MAX //(4294967295U)
-# define UINT_LEAST64_MAX UINT64_MAX //(18446744073709551615ULL)
-
-# define INT_FAST8_MIN INT8_MIN //(-128)
-//# define INT_FAST16_MIN (-32767-1)
-//# define INT_FAST32_MIN (-2147483647-1)
-# define INT_FAST64_MIN INT64_MIN //(-9223372036854775807LL-1)
-
-# define INT_FAST8_MAX INT8_MAX //(127)
-//# define INT_FAST16_MAX (32767)
-//# define INT_FAST32_MAX (2147483647)
-# define INT_FAST64_MAX INT64_MAX //(9223372036854775807LL)
-
-# define UINT_FAST8_MAX UINT8_MAX //(255U)
-//# define UINT_FAST16_MAX (65535U)
-//# define UINT_FAST32_MAX (4294967295U)
-# define UINT_FAST64_MAX UINT64_MAX //(18446744073709551615ULL)
-
-//FIXME: Move *INTPTR to architecture specific as they vary
-//# define INTPTR_MIN (-2147483647-1)
-//# define INTPTR_MAX (2147483647)
-//# define UINTPTR_MAX (4294967295U)
-
-# define INTMAX_MIN (-9223372036854775807LL-1)
-# define INTMAX_MAX (9223372036854775807LL)
-# define UINTMAX_MAX (18446744073709551615ULL)
-
-/* FIXME: include the architecture specific limits from bitsizexx/stdintlimits.h */
-/* ptrdiff_t limit */
-//# define PTRDIFF_MIN (-2147483647-1)
-//# define PTRDIFF_MAX (2147483647)
-
-/* sig_atomic_t limit */
-//# define SIG_ATOMIC_MIN (-2147483647-1)
-//# define SIG_ATOMIC_MAX (2147483647)
-
-/* size_t limit */
-//# define SIZE_MAX (4294967295U)
+#define INT_FAST8_MIN INT8_MIN
+#define INT_FAST64_MIN INT64_MIN
-#include <bitsize/stdintlimits.h>
+#define INT_FAST8_MAX INT8_MAX
+#define INT_FAST64_MAX INT64_MAX
-#endif /* STDC_LIMIT_MACROS */
+#define UINT_FAST8_MAX UINT8_MAX
+#define UINT_FAST64_MAX UINT64_MAX
-#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
+#define INTMAX_MIN INT64_MIN
+#define INTMAX_MAX INT64_MAX
+#define UINTMAX_MAX UINT64_MAX
+
+#include <bitsize/stdintlimits.h>
-# define INT8_C(n) n
-# define INT16_C(n) n
-# define INT32_C(n) n
-# define INT64_C(n) n ## LL
+#endif
-# define UINT8_C(n) n ## U
-# define UINT16_C(n) n ## U
-# define UINT32_C(n) n ## U
-# define UINT64_C(n) n ## ULL
+#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
-//# define INTMAX_C(n) n ## LL
-//# define UINTMAX_C(n) n ## ULL
+#define INT8_C(c) c
+#define INT16_C(c) c
+#define INT32_C(c) c
+#define INT64_C(c) __INT64_C(c)
-/* included from klibc/usr/include/stdint.h */
+#define UINT8_C(c) c ## U
+#define UINT16_C(c) c ## U
+#define UINT32_C(c) c ## U
+#define UINT64_C(c) __UINT64_C(c)
#define INT_LEAST8_C(c) INT8_C(c)
#define INT_LEAST16_C(c) INT16_C(c)
@@ -171,6 +107,10 @@ typedef uint64_t uintmax_t;
#define UINTMAX_C(c) UINT64_C(c)
#include <bitsize/stdintconst.h>
-#endif /* STDC_CONSTANT_MACROS */
-#endif /* _STDINT_H */
+#endif
+
+/* Keep the kernel from trying to define these types... */
+#define __BIT_TYPES_DEFINED__
+
+#endif /* _STDINT_H */