From aa43ba40c72a6f499ff4f4729c787b2975bd29b9 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 11 Dec 2010 21:03:56 -0700 Subject: [PATCH] win64: HIWORD and LOWORD signs --- collects/mred/private/wx/win32/types.rkt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/collects/mred/private/wx/win32/types.rkt b/collects/mred/private/wx/win32/types.rkt index 2291992996..288dfa4b31 100644 --- a/collects/mred/private/wx/win32/types.rkt +++ b/collects/mred/private/wx/win32/types.rkt @@ -127,10 +127,15 @@ [time _DWORD] [pt _POINT])) +(define (short v) + (if (zero? (bitwise-and #x8000 v)) + v + (bitwise-ior v (arithmetic-shift -1 15)))) + (define (HIWORD v) - (arithmetic-shift v -16)) + (short (arithmetic-shift v -16))) (define (LOWORD v) - (bitwise-and v #xFFFF)) + (short (bitwise-and v #xFFFF))) (define (MAKELONG a b) (bitwise-ior (arithmetic-shift b 16)