From 8f512001b610fe20f9d377104837ec4cca65d305 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 24 Aug 2023 16:49:56 +0100 Subject: [PATCH] Shut up the type checker --- vendor/darwin/Foundation/NSEvent.odin | 105 +++++++++++++++++--------- 1 file changed, 70 insertions(+), 35 deletions(-) diff --git a/vendor/darwin/Foundation/NSEvent.odin b/vendor/darwin/Foundation/NSEvent.odin index d604575bb..6e960a4f2 100644 --- a/vendor/darwin/Foundation/NSEvent.odin +++ b/vendor/darwin/Foundation/NSEvent.odin @@ -8,41 +8,76 @@ Event :: struct {using _: Object} EventMask :: distinct bit_set[EventType; UInteger] EventMaskAny :: ~EventMask{} -EventType :: enum UInteger { - LeftMouseDown = 1, - LeftMouseUp = 2, - RightMouseDown = 3, - RightMouseUp = 4, - MouseMoved = 5, - LeftMouseDragged = 6, - RightMouseDragged = 7, - MouseEntered = 8, - MouseExited = 9, - KeyDown = 10, - KeyUp = 11, - FlagsChanged = 12, - AppKitDefined = 13, - SystemDefined = 14, - ApplicationDefined = 15, - Periodic = 16, - CursorUpdate = 17, - Rotate = 18, - BeginGesture = 19, - EndGesture = 20, - ScrollWheel = 22, - TabletPoint = 23, - TabletProximity = 24, - OtherMouseDown = 25, - OtherMouseUp = 26, - OtherMouseDragged = 27, - Gesture = 29, - Magnify = 30, - Swipe = 31, - SmartMagnify = 32, - QuickLook = 33, - Pressure = 34, - DirectTouch = 37, - ChangeMode = 38, +when size_of(UInteger) == 4 { + // We don't support a 32-bit darwin system but this is mostly to shut up -vet for the time being + EventType :: enum UInteger { + LeftMouseDown = 1, + LeftMouseUp = 2, + RightMouseDown = 3, + RightMouseUp = 4, + MouseMoved = 5, + LeftMouseDragged = 6, + RightMouseDragged = 7, + MouseEntered = 8, + MouseExited = 9, + KeyDown = 10, + KeyUp = 11, + FlagsChanged = 12, + AppKitDefined = 13, + SystemDefined = 14, + ApplicationDefined = 15, + Periodic = 16, + CursorUpdate = 17, + Rotate = 18, + BeginGesture = 19, + EndGesture = 20, + ScrollWheel = 22, + TabletPoint = 23, + TabletProximity = 24, + OtherMouseDown = 25, + OtherMouseUp = 26, + OtherMouseDragged = 27, + Gesture = 29, + Magnify = 30, + Swipe = 31, + } +} else { + EventType :: enum UInteger { + LeftMouseDown = 1, + LeftMouseUp = 2, + RightMouseDown = 3, + RightMouseUp = 4, + MouseMoved = 5, + LeftMouseDragged = 6, + RightMouseDragged = 7, + MouseEntered = 8, + MouseExited = 9, + KeyDown = 10, + KeyUp = 11, + FlagsChanged = 12, + AppKitDefined = 13, + SystemDefined = 14, + ApplicationDefined = 15, + Periodic = 16, + CursorUpdate = 17, + Rotate = 18, + BeginGesture = 19, + EndGesture = 20, + ScrollWheel = 22, + TabletPoint = 23, + TabletProximity = 24, + OtherMouseDown = 25, + OtherMouseUp = 26, + OtherMouseDragged = 27, + Gesture = 29, + Magnify = 30, + Swipe = 31, + SmartMagnify = 32, + QuickLook = 33, + Pressure = 34, + DirectTouch = 37, + ChangeMode = 38, + } } EventPhase :: distinct bit_set[EventPhaseFlag; UInteger]