Re: [AD] 64-bit intptr_t on WIndows |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: "Coordination of admins/developers of the game programming library Allegro" <alleg-developers@xxxxxxxxxx>
- Subject: Re: [AD] 64-bit intptr_t on WIndows
- From: Matthew Leverton <meffer@xxxxxxxxxx>
- Date: Mon, 24 Aug 2009 23:27:13 -0500
Attached is a patch to add better detection of intptr_t for Windows 64-bit.
--
Matthew Leverton
Index: 4.9/include/allegro5/platform/astdint.h
===================================================================
--- 4.9/include/allegro5/platform/astdint.h (revision 12508)
+++ 4.9/include/allegro5/platform/astdint.h (working copy)
@@ -38,9 +38,34 @@
#define uint16_t unsigned short
#define int32_t signed int
#define uint32_t unsigned int
- #define intptr_t int32_t
- #define uintptr_t uint32_t
+ #ifdef ALLEGRO_WINDOWS
+
+ #ifndef _INTPTR_T_DEFINED
+ #ifdef _WIN64
+ #define intptr_t __int64
+ #else
+ #define intptr_t int
+ #endif
+ #define _INTPTR_T_DEFINED
+ #endif
+
+ #ifndef _UINTPTR_T_DEFINED
+ #ifdef _WIN64
+ #define uintptr_t unsigned __int64
+ #else
+ #define uintptr_t unsigned int
+ #endif
+ #define _UINTPTR_T_DEFINED
+ #endif
+
+ #else
+
+ #define intptr_t int32_t
+ #define uintptr_t uint32_t
+
+ #endif
+
#else
#error I dunno how to get the definitions of fixed-width integer types on your platform. Please report this to your friendly Allegro developer.
#endif