Eric Pouech : include: Define HandleToU?Long to return a long (as SDK does).

Alexandre Julliard julliard at winehq.org
Mon Jan 31 15:55:19 CST 2022


Module: wine
Branch: master
Commit: f2e0c5cab2366c038680796bc7ddf780fc4eb01b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=f2e0c5cab2366c038680796bc7ddf780fc4eb01b

Author: Eric Pouech <eric.pouech at gmail.com>
Date:   Mon Jan 31 14:13:33 2022 +0100

include: Define HandleToU?Long to return a long (as SDK does).

Signed-off-by: Eric Pouech <eric.pouech at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 include/basetsd.h | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/include/basetsd.h b/include/basetsd.h
index a46172403ef..329db66c8f0 100644
--- a/include/basetsd.h
+++ b/include/basetsd.h
@@ -153,16 +153,32 @@ typedef unsigned int UHALF_PTR, *PUHALF_PTR;
 
 #if !defined(__midl) && !defined(__WIDL__)
 
-static inline ULONG32 HandleToULong(const void *h)
+#if !defined(__LP64__) && !defined(WINE_NO_LONG_TYPES)
+
+static inline unsigned long HandleToULong(const void *h)
+{
+    return (unsigned long)(ULONG_PTR)h;
+}
+
+static inline long HandleToLong(const void *h)
+{
+    return (long)(LONG_PTR)h;
+}
+
+#else
+
+static inline unsigned HandleToULong(const void *h)
 {
-    return (ULONG32)(ULONG_PTR)h;
+    return (unsigned)(ULONG_PTR)h;
 }
 
-static inline LONG32 HandleToLong(const void *h)
+static inline int HandleToLong(const void *h)
 {
-    return (LONG32)(LONG_PTR)h;
+    return (int)(LONG_PTR)h;
 }
 
+#endif /* !defined(__LP64__) && !defined(WINE_NO_LONG_TYPES) */
+
 static inline void *ULongToHandle(ULONG32 ul)
 {
     return (void *)(ULONG_PTR)ul;




More information about the wine-cvs mailing list