summarylogtreecommitdiffstats
path: root/1004_64-bit-architectures.patch
diff options
context:
space:
mode:
Diffstat (limited to '1004_64-bit-architectures.patch')
-rw-r--r--1004_64-bit-architectures.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/1004_64-bit-architectures.patch b/1004_64-bit-architectures.patch
new file mode 100644
index 000000000000..d8aa139ac715
--- /dev/null
+++ b/1004_64-bit-architectures.patch
@@ -0,0 +1,27 @@
+The current definitions wrongly assume the only 64-bit architecture is
+x86-64. Use the __ILP64__, __LP64__ and __LLP64__ to correctly define
+the size of a long and of pointer.
+
+Ideally long, intptr_t and uintptr_t should be used directly but there
+might be a (portability ?) reason why it is not the case.
+
+--- a/winpr/include/winpr/wtypes.h
++++ b/winpr/include/winpr/wtypes.h
+@@ -37,7 +37,7 @@
+ #define __int32 int
+ #define __int64 long long
+
+-#if __x86_64__
++#if __ILP64__ || __LP64__
+ #define __int3264 __int64
+ #else
+ #define __int3264 __int32
+@@ -136,7 +136,7 @@ typedef void *PVOID64, *LPVOID64;
+ typedef const void *LPCVOID;
+ typedef unsigned short WORD, *PWORD, *LPWORD;
+
+-#if __x86_64__
++#if __ILP64__ || __LP64__ || __LLP64__
+ typedef __int64 INT_PTR;
+ typedef unsigned __int64 UINT_PTR;
+ #else