aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2003-04-22 14:55:01 +0000
committerCorinna Vinschen <corinna@vinschen.de>2003-04-22 14:55:01 +0000
commite8a57b4fc7cec3447c6e9d91a507fe19ae92898f (patch)
tree20fa0b1c34d25cbcb2b91aad66e1ddb08054df38 /winsup
parent650dc784e54426275e60161ccc9de22ae711f276 (diff)
downloadnewlib-e8a57b4fc7cec3447c6e9d91a507fe19ae92898f.zip
newlib-e8a57b4fc7cec3447c6e9d91a507fe19ae92898f.tar.gz
newlib-e8a57b4fc7cec3447c6e9d91a507fe19ae92898f.tar.bz2
* include/inttypes.h: New file.
* include/stdint.h: New file. * include/cygwin/in.h: Include stdint.h instead of sys/types.h. * include/cygwin/types.h: Include stdint.h. Remove typedefs for intN_t and uintN_t since these are defined in stdint.h now.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog8
-rw-r--r--winsup/cygwin/include/cygwin/in.h2
-rw-r--r--winsup/cygwin/include/cygwin/types.h45
-rw-r--r--winsup/cygwin/include/inttypes.h246
-rw-r--r--winsup/cygwin/include/stdint.h182
5 files changed, 438 insertions, 45 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 37d17d7..45602de 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,11 @@
+2003-04-22 Corinna Vinschen <corinna@vinschen.de>
+
+ * include/inttypes.h: New file.
+ * include/stdint.h: New file.
+ * include/cygwin/in.h: Include stdint.h instead of sys/types.h.
+ * include/cygwin/types.h: Include stdint.h. Remove typedefs for
+ intN_t and uintN_t since these are defined in stdint.h now.
+
2003-04-21 Christopher Faylor <cgf@redhat.com>
* include/cygwin/version.h: Bump DLL major number to 1005. Change DLL
diff --git a/winsup/cygwin/include/cygwin/in.h b/winsup/cygwin/include/cygwin/in.h
index af880f1..a212455 100644
--- a/winsup/cygwin/include/cygwin/in.h
+++ b/winsup/cygwin/include/cygwin/in.h
@@ -18,7 +18,7 @@
#ifndef _CYGWIN_IN_H
#define _CYGWIN_IN_H
-#include <sys/types.h>
+#include <stdint.h>
/* Standard well-defined IP protocols. */
enum
diff --git a/winsup/cygwin/include/cygwin/types.h b/winsup/cygwin/include/cygwin/types.h
index d5173b9..78b240e 100644
--- a/winsup/cygwin/include/cygwin/types.h
+++ b/winsup/cygwin/include/cygwin/types.h
@@ -18,6 +18,7 @@ extern "C"
#define _CYGWIN_TYPES_H
#include <sys/sysmacros.h>
+#include <stdint.h>
#ifndef __timespec_t_defined
#define __timespec_t_defined
@@ -109,40 +110,6 @@ typedef unsigned long vm_offset_t;
typedef unsigned long vm_size_t;
#endif /*__vm_size_t_defined*/
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef char int8_t;
-#endif
-#ifndef __int16_t_defined
-#define __int16_t_defined
-typedef __int16_t int16_t;
-#endif
-#ifndef __int32_t_defined
-#define __int32_t_defined
-typedef __int32_t int32_t;
-#endif
-#ifndef __int64_t_defined
-#define __int64_t_defined
-typedef __int64_t int64_t;
-#endif
-
-#ifndef __uint8_t_defined
-#define __uint8_t_defined
-typedef unsigned char uint8_t;
-#endif
-#ifndef __uint16_t_defined
-#define __uint16_t_defined
-typedef __uint16_t uint16_t;
-#endif
-#ifndef __uint32_t_defined
-#define __uint32_t_defined
-typedef __uint32_t uint32_t;
-#endif
-#ifndef __uint64_t_defined
-#define __uint64_t_defined
-typedef __uint64_t uint64_t;
-#endif
-
#ifndef __u_int8_t_defined
#define __u_int8_t_defined
typedef unsigned char u_int8_t;
@@ -160,16 +127,6 @@ typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;
#endif
-#ifndef __uintptr_t_defined
-#define __uintptr_t_defined
-typedef unsigned long uintptr_t;
-#endif
-
-#ifndef __intptr_t_defined
-#define __intptr_t_defined
-typedef long intptr_t;
-#endif
-
#ifndef __register_t_defined
#define __register_t_defined
typedef __int32_t register_t;
diff --git a/winsup/cygwin/include/inttypes.h b/winsup/cygwin/include/inttypes.h
new file mode 100644
index 0000000..1d0410a
--- /dev/null
+++ b/winsup/cygwin/include/inttypes.h
@@ -0,0 +1,246 @@
+/* inttypes.h - fixed size integer types
+
+ Copyright 2003 Red Hat, Inc.
+
+This file is part of Cygwin.
+
+This software is a copyrighted work licensed under the terms of the
+Cygwin license. Please consult the file "CYGWIN_LICENSE" for
+details. */
+
+#ifndef _INTTYPES_H
+#define _INTTYPES_H
+
+#include <stdint.h>
+
+/* fprintf() macros for signed integers */
+
+#define PRId8 "d"
+#define PRId16 "d"
+#define PRId32 "ld"
+#define PRId64 "lld"
+
+#define PRIdLEAST8 "d"
+#define PRIdLEAST16 "d"
+#define PRIdLEAST32 "ld"
+#define PRIdLEAST64 "lld"
+
+#define PRIdFAST8 "d"
+#define PRIdFAST16 "ld"
+#define PRIdFAST32 "ld"
+#define PRIdFAST64 "lld"
+
+#define PRIdMAX "lld"
+#define PRIdPTR "ld"
+
+#define PRIi8 "i"
+#define PRIi16 "i"
+#define PRIi32 "li"
+#define PRIi64 "lli"
+
+#define PRIiLEAST8 "i"
+#define PRIiLEAST16 "i"
+#define PRIiLEAST32 "li"
+#define PRIiLEAST64 "lli"
+
+#define PRIiFAST8 "i"
+#define PRIiFAST16 "li"
+#define PRIiFAST32 "li"
+#define PRIiFAST64 "lli"
+
+#define PRIiMAX "lli"
+#define PRIiPTR "li"
+
+/* fprintf() macros for unsigned integers */
+
+#define PRIo8 "o"
+#define PRIo16 "o"
+#define PRIo32 "lo"
+#define PRIo64 "llo"
+
+#define PRIoLEAST8 "o"
+#define PRIoLEAST16 "o"
+#define PRIoLEAST32 "lo"
+#define PRIoLEAST64 "llo"
+
+#define PRIoFAST8 "o"
+#define PRIoFAST16 "lo"
+#define PRIoFAST32 "lo"
+#define PRIoFAST64 "llo"
+
+#define PRIoMAX "llo"
+#define PRIoPTR "lo"
+
+#define PRIu8 "u"
+#define PRIu16 "u"
+#define PRIu32 "lu"
+#define PRIu64 "llu"
+
+#define PRIuLEAST8 "u"
+#define PRIuLEAST16 "u"
+#define PRIuLEAST32 "lu"
+#define PRIuLEAST64 "llu"
+
+#define PRIuFAST8 "u"
+#define PRIuFAST16 "lu"
+#define PRIuFAST32 "lu"
+#define PRIuFAST64 "llu"
+
+#define PRIuMAX "llu"
+#define PRIuPTR "lu"
+
+#define PRIx8 "x"
+#define PRIx16 "x"
+#define PRIx32 "lx"
+#define PRIx64 "llx"
+
+#define PRIxLEAST8 "x"
+#define PRIxLEAST16 "x"
+#define PRIxLEAST32 "lx"
+#define PRIxLEAST64 "llx"
+
+#define PRIxFAST8 "x"
+#define PRIxFAST16 "lx"
+#define PRIxFAST32 "lx"
+#define PRIxFAST64 "llx"
+
+#define PRIxMAX "llx"
+#define PRIxPTR "lx"
+
+#define PRIX8 "X"
+#define PRIX16 "X"
+#define PRIX32 "lX"
+#define PRIX64 "llX"
+
+#define PRIXLEAST8 "X"
+#define PRIXLEAST16 "X"
+#define PRIXLEAST32 "lX"
+#define PRIXLEAST64 "llX"
+
+#define PRIXFAST8 "X"
+#define PRIXFAST16 "lX"
+#define PRIXFAST32 "lX"
+#define PRIXFAST64 "llX"
+
+#define PRIXMAX "llX"
+#define PRIXPTR "lX"
+
+/* fscanf() macros for signed integers */
+
+#define SCNd8 "hhd"
+#define SCNd16 "hd"
+#define SCNd32 "ld"
+#define SCNd64 "lld"
+
+#define SCNdLEAST8 "hhd"
+#define SCNdLEAST16 "hd"
+#define SCNdLEAST32 "ld"
+#define SCNdLEAST64 "lld"
+
+#define SCNdFAST8 "hhd"
+#define SCNdFAST16 "ld"
+#define SCNdFAST32 "ld"
+#define SCNdFAST64 "lld"
+
+#define SCNdMAX "lld"
+#define SCNdPTR "ld"
+
+#define SCNi8 "hhi"
+#define SCNi16 "hi"
+#define SCNi32 "li"
+#define SCNi64 "lli"
+
+#define SCNiLEAST8 "hhi"
+#define SCNiLEAST16 "hi"
+#define SCNiLEAST32 "li"
+#define SCNiLEAST64 "lli"
+
+#define SCNiFAST8 "hhi"
+#define SCNiFAST16 "li"
+#define SCNiFAST32 "li"
+#define SCNiFAST64 "lli"
+
+#define SCNiMAX "lli"
+#define SCNiPTR "li"
+
+/* fscanf() macros for unsigned integers */
+
+#define SCNo8 "hho"
+#define SCNo16 "ho"
+#define SCNo32 "lo"
+#define SCNo64 "llo"
+
+#define SCNoLEAST8 "hho"
+#define SCNoLEAST16 "ho"
+#define SCNoLEAST32 "lo"
+#define SCNoLEAST64 "llo"
+
+#define SCNoFAST8 "hho"
+#define SCNoFAST16 "lo"
+#define SCNoFAST32 "lo"
+#define SCNoFAST64 "llo"
+
+#define SCNoMAX "llo"
+#define SCNoPTR "lo"
+
+#define SCNu8 "hhu"
+#define SCNu16 "hu"
+#define SCNu32 "lu"
+#define SCNu64 "llu"
+
+#define SCNuLEAST8 "hhu"
+#define SCNuLEAST16 "hu"
+#define SCNuLEAST32 "lu"
+#define SCNuLEAST64 "llu"
+
+#define SCNuFAST8 "hhu"
+#define SCNuFAST16 "lu"
+#define SCNuFAST32 "lu"
+#define SCNuFAST64 "llu"
+
+#define SCNuMAX "llu"
+#define SCNuPTR "lu"
+
+#define SCNx8 "hhx"
+#define SCNx16 "hx"
+#define SCNx32 "lx"
+#define SCNx64 "llx"
+
+#define SCNxLEAST8 "hhx"
+#define SCNxLEAST16 "hx"
+#define SCNxLEAST32 "lx"
+#define SCNxLEAST64 "llx"
+
+#define SCNxFAST8 "hhx"
+#define SCNxFAST16 "lx"
+#define SCNxFAST32 "lx"
+#define SCNxFAST64 "llx"
+
+#define SCNxMAX "llx"
+#define SCNxPTR "lx"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <_ansi.h>
+
+typedef struct {
+ intmax_t quot;
+ intmax_t rem;
+} imaxdiv_t;
+
+#if 0 /* Not yet defined */
+intmax_t _EXFUN(imaxabs, (intmax_t));
+imaxdiv_t _EXFUN(imaxdiv, (intmax_t, intmax_t));
+intmax_t _EXFUN(strtoimax, (const char *, char **, int));
+uintmax_t _EXFUN(strtoumax, (const char *, char **, int));
+intmax_t _EXFUN(wcstoimax, (const wchar_t *, wchar_t **, int));
+uintmax_t _EXFUN(wcstoumax, (const wchar_t *, wchar_t **, int));
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _INTTYPES_H */
diff --git a/winsup/cygwin/include/stdint.h b/winsup/cygwin/include/stdint.h
new file mode 100644
index 0000000..66fd49d
--- /dev/null
+++ b/winsup/cygwin/include/stdint.h
@@ -0,0 +1,182 @@
+/* stdint.h - integer types
+
+ Copyright 2003 Red Hat, Inc.
+
+This file is part of Cygwin.
+
+This software is a copyrighted work licensed under the terms of the
+Cygwin license. Please consult the file "CYGWIN_LICENSE" for
+details. */
+
+#ifndef _STDINT_H
+#define _STDINT_H
+
+/* Exact-width integer types */
+
+#ifndef __int8_t_defined
+#define __int8_t_defined
+typedef signed char int8_t;
+typedef short int16_t;
+typedef long int32_t;
+typedef long long int64_t;
+#endif
+
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+#ifndef __uint32_t_defined
+#define __uint32_t_defined
+typedef unsigned long uint32_t;
+#endif
+typedef unsigned long long uint64_t;
+
+/* Minimum-width integer types */
+
+typedef signed char int_least8_t;
+typedef short int_least16_t;
+typedef long int_least32_t;
+typedef long long int_least64_t;
+
+typedef unsigned char uint_least8_t;
+typedef unsigned short uint_least16_t;
+typedef unsigned long uint_least32_t;
+typedef unsigned long long uint_least64_t;
+
+/* Fastest minimum-width integer types */
+
+typedef signed char int_fast8_t;
+typedef long int_fast16_t;
+typedef long int_fast32_t;
+typedef long long int_fast64_t;
+
+typedef unsigned char uint_fast8_t;
+typedef unsigned long uint_fast16_t;
+typedef unsigned long uint_fast32_t;
+typedef unsigned long long uint_fast64_t;
+
+/* Integer types capable of holding object pointers */
+
+#ifndef __intptr_t_defined
+#define __intptr_t_defined
+typedef long intptr_t;
+#endif
+typedef unsigned long uintptr_t;
+
+/* Greatest-width integer types */
+
+typedef long long intmax_t;
+typedef unsigned long long uintmax_t;
+
+/* Limits of exact-width integer types */
+
+#define INT8_MIN (-128)
+#define INT16_MIN (-32768)
+#define INT32_MIN (-2147483648)
+#define INT64_MIN (-9223372036854775808)
+
+#define INT8_MAX (127)
+#define INT16_MAX (32767)
+#define INT32_MAX (2147483647)
+#define INT64_MAX (9223372036854775807)
+
+#define UINT8_MAX (255)
+#define UINT16_MAX (65535)
+#define UINT32_MAX (4294967295UL)
+#define UINT64_MAX (18446744073709551615ULL)
+
+/* Limits of minimum-width integer types */
+
+#define INT_LEAST8_MIN (-128)
+#define INT_LEAST16_MIN (-32768)
+#define INT_LEAST32_MIN (-2147483648)
+#define INT_LEAST64_MIN (-9223372036854775808)
+
+#define INT_LEAST8_MAX (127)
+#define INT_LEAST16_MAX (32767)
+#define INT_LEAST32_MAX (2147483647)
+#define INT_LEAST64_MAX (9223372036854775807)
+
+#define UINT_LEAST8_MAX (255)
+#define UINT_LEAST16_MAX (65535)
+#define UINT_LEAST32_MAX (4294967295UL)
+#define UINT_LEAST64_MAX (18446744073709551615ULL)
+
+/* Limits of fastest minimum-width integer types */
+
+#define INT_FAST8_MIN (-128)
+#define INT_FAST16_MIN (-2147483648)
+#define INT_FAST32_MIN (-2147483648)
+#define INT_FAST64_MIN (-9223372036854775808)
+
+#define INT_FAST8_MAX (127)
+#define INT_FAST16_MAX (2147483647)
+#define INT_FAST32_MAX (2147483647)
+#define INT_FAST64_MAX (9223372036854775807)
+
+#define UINT_FAST8_MAX (255)
+#define UINT_FAST16_MAX (4294967295UL)
+#define UINT_FAST32_MAX (4294967295UL)
+#define UINT_FAST64_MAX (18446744073709551615ULL)
+
+/* Limits of integer types capable of holding object pointers */
+
+#define INTPTR_MIN (-2147483648)
+#define INTPTR_MAX (2147483647)
+#define UINTPTR_MAX (4294967295UL)
+
+/* Limits of greatest-width integer types */
+
+#define INTMAX_MIN (-9223372036854775808)
+#define INTMAX_MAX (9223372036854775807)
+#define UINTMAX_MAX (18446744073709551615ULL)
+
+/* Limits of other integer types */
+
+#ifndef PTRDIFF_MIN
+#define PTRDIFF_MIN (-2147483648)
+#define PTRDIFF_MAX (2147483647)
+#endif
+
+#ifndef SIG_ATOMIC_MIN
+#define SIG_ATOMIC_MIN (-2147483648)
+#endif
+#ifndef SIG_ATOMIC_MAX
+#define SIG_ATOMIC_MAX (2147483647)
+#endif
+
+#ifndef SIZE_MAX
+#define SIZE_MAX (4294967295UL)
+#endif
+
+#ifndef WCHAR_MIN
+#ifdef __WCHAR_MIN__
+#define WCHAR_MIN __WCHAR_MIN__
+#define WCHAR_MAX __WCHAR_MAX__
+#else
+#define WCHAR_MIN (0)
+#define WCHAR_MAX (65535)
+#endif
+#endif
+
+#ifndef WINT_MIN
+#define WINT_MIN (-2147483648)
+#define WINT_MAX (2147483647)
+#endif
+
+/* Macros for minimum-width integer constant expressions */
+
+#define INT8_C(x) x
+#define INT16_C(x) x
+#define INT32_C(x) x ## L
+#define INT64_C(x) x ## LL
+
+#define UINT8_C(x) x ## U
+#define UINT16_C(x) x ## U
+#define UINT32_C(x) x ## UL
+#define UINT64_C(x) x ## ULL
+
+/* Macros for greatest-width integer constant expressions */
+
+#define INTMAX_C(x) x ## L
+#define UINTMAX_C(x) x ## UL
+
+#endif /* _STDINT_H */