diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2007-05-08 03:42:27 +0400 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2007-05-08 03:42:27 +0400 |
commit | 993e75f6770549cde57245e9a1caad39e2ab3c5a (patch) | |
tree | 596787c1a47071d3da80fd3cf3817682037698f2 /winsup/mingw | |
parent | 8f954ad3f84969f71133a70e78bb5a290950dbdc (diff) |
* include/stdint.h (intptr_t): Protect with _INTPTR_T_DEFINED.
Condition on _WIN64.
(uintptr_t): Protect with _UINTPTR_T_DEFINED. Condition on _WIN64.
(INTPTR_MIN, INTPTR_MAX, UINTPTR_MAX): Condition on _WIN64.
(PTRDIFF_MIN): Define as INTPTR_MIN.
(PTRDIFF_MAX): Define as INTPTR_MAX.
(SIG_ATOMIC_MIN): Define as INTPTR_MIN.
(SIG_ATOMIC_MAX): Define as INTPTR_MAX.
Diffstat (limited to 'winsup/mingw')
-rw-r--r-- | winsup/mingw/ChangeLog | 13 | ||||
-rw-r--r-- | winsup/mingw/include/stdint.h | 40 |
2 files changed, 43 insertions, 10 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index a61a498b1..011c1fb62 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,3 +1,14 @@ +2007-05-07 Danny Smith <dannysmith@users.sourceforge.net> + + * include/stdint.h (intptr_t): Protect with _INTPTR_T_DEFINED. + Condition on _WIN64. + (uintptr_t): Protect with _UINTPTR_T_DEFINED. Condition on _WIN64. + (INTPTR_MIN, INTPTR_MAX, UINTPTR_MAX): Condition on _WIN64. + (PTRDIFF_MIN): Define as INTPTR_MIN. + (PTRDIFF_MAX): Define as INTPTR_MAX. + (SIG_ATOMIC_MIN): Define as INTPTR_MIN. + (SIG_ATOMIC_MAX): Define as INTPTR_MAX. + 2007-04-07 Chris Sutcliffe <ir0nh34d@users.sourceforge.net> * Makefile.in: Removed mansuffix variable. Changed mansection to support @@ -16,7 +27,7 @@ * include/_mingw.h (__CRT_INLINE): Make conditional on __GNUC_STDC_INLINE__. -2003-03-20 Chris Sutcliffe <ir0nh34d@users.sourceforge.net> +2007-03-20 Chris Sutcliffe <ir0nh34d@users.sourceforge.net> * Makefile.in: Tweak srcdist to fix build issue. diff --git a/winsup/mingw/include/stdint.h b/winsup/mingw/include/stdint.h index 5241d48b3..07d955ae2 100644 --- a/winsup/mingw/include/stdint.h +++ b/winsup/mingw/include/stdint.h @@ -57,12 +57,28 @@ typedef long long int_fast64_t; typedef unsigned long long uint_fast64_t; /* 7.18.1.4 Integer types capable of holding object pointers */ -typedef int intptr_t; -typedef unsigned uintptr_t; + +#ifndef _INTPTR_T_DEFINED +#define _INTPTR_T_DEFINED +#ifdef _WIN64 + typedef __int64 uintptr_t; +#else + typedef int uintptr_t; +#endif +#endif + +#ifndef _UINTPTR_T_DEFINED +#define _UINTPTR_T_DEFINED +#ifdef _WIN64 + typedef unsigned __int64 uintptr_t; +#else + typedef unsigned int uintptr_t; +#endif +#endif /* 7.18.1.5 Greatest-width integer types */ typedef long long intmax_t; -typedef unsigned long long uintmax_t; +typedef unsigned long long uintmax_t; /* 7.18.2 Limits of specified-width integer types */ #if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS) @@ -116,10 +132,16 @@ typedef unsigned long long uintmax_t; #define UINT_FAST64_MAX UINT64_MAX /* 7.18.2.4 Limits of integer types capable of holding - object pointers */ + object pointers */ +#ifdef _WIN64 +#define INTPTR_MIN INT64_MIN +#define INTPTR_MAX INT64_MAX +#define UINTPTR_MAX UINT64_MAX +#else #define INTPTR_MIN INT32_MIN #define INTPTR_MAX INT32_MAX #define UINTPTR_MAX UINT32_MAX +#endif /* 7.18.2.5 Limits of greatest-width integer types */ #define INTMAX_MIN INT64_MIN @@ -127,13 +149,13 @@ typedef unsigned long long uintmax_t; #define UINTMAX_MAX UINT64_MAX /* 7.18.3 Limits of other integer types */ -#define PTRDIFF_MIN INT32_MIN -#define PTRDIFF_MAX INT32_MAX +#define PTRDIFF_MIN INTPTR_MIN +#define PTRDIFF_MAX INTPTR_MAX -#define SIG_ATOMIC_MIN INT32_MIN -#define SIG_ATOMIC_MAX INT32_MAX +#define SIG_ATOMIC_MIN INTPTR_MIN +#define SIG_ATOMIC_MAX INTPTR_MAX -#define SIZE_MAX UINT32_MAX +#define SIZE_MAX UINTPTR_MAX #ifndef WCHAR_MIN /* also in wchar.h */ #define WCHAR_MIN 0 |