Skip to content

Commit 3310e4b

Browse files
committed
inc: winapi fixes and more #defines turned into constants
* many more #defines are now turned into proper constants, for example those with math expressions referencing other constants (e.g. <#define B (A + 1)>) are now turned into constants, while previously it was just alias-#defines (i.e. <#define B A>). In case of the Windows API binding, uses of MinGw-w64's __MSABI_LONG() macro are now removed (or rather, expanded), which also allowed lots of #defines to become constants. See also 34b46cf. * winapi: culng() casts added for win/commctrl.bi's NM_* constants (and also a few other cases) where they were missing. See also d26035a. http://www.freebasic.net/forum/viewtopic.php?f=6&t=23901
1 parent 5d0a478 commit 3310e4b

File tree

199 files changed

+9904
-9882
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+9904
-9882
lines changed

Diff for: changelog.txt

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Version 1.04.0
6060
- Many bindings and especially the Windows API binding now use more proper Const/Type/Extern/Sub/Function declarations instead of #defines, allowing many identifiers (such as "LoadImage" which is also a Windows API function) to be used for custom functions in namespaces, even if the file #includes windows.bi or others.
6161
- 1.02.0 regression: Windows API binding: COM interfaces in win/shlobj.bi were missing vtable entries
6262
- #761: crt/string.bi and win/shlwapi.bi can now be used together - they use #undefs to override each-other (e.g. strcpy() vs StrCpy()), whichever is #included last wins.
63+
- Windows API binding: The NM_* constants from win/commctrl.bi are now adjusted to work on 64bit.
6364

6465

6566
Version 1.03.0

Diff for: inc/GL/glfw.bi

+70-70
Original file line numberDiff line numberDiff line change
@@ -75,76 +75,76 @@ const GLFW_PRESS = 1
7575
const GLFW_KEY_UNKNOWN = -1
7676
const GLFW_KEY_SPACE = 32
7777
const GLFW_KEY_SPECIAL = 256
78-
#define GLFW_KEY_ESC (GLFW_KEY_SPECIAL + 1)
79-
#define GLFW_KEY_F1 (GLFW_KEY_SPECIAL + 2)
80-
#define GLFW_KEY_F2 (GLFW_KEY_SPECIAL + 3)
81-
#define GLFW_KEY_F3 (GLFW_KEY_SPECIAL + 4)
82-
#define GLFW_KEY_F4 (GLFW_KEY_SPECIAL + 5)
83-
#define GLFW_KEY_F5 (GLFW_KEY_SPECIAL + 6)
84-
#define GLFW_KEY_F6 (GLFW_KEY_SPECIAL + 7)
85-
#define GLFW_KEY_F7 (GLFW_KEY_SPECIAL + 8)
86-
#define GLFW_KEY_F8 (GLFW_KEY_SPECIAL + 9)
87-
#define GLFW_KEY_F9 (GLFW_KEY_SPECIAL + 10)
88-
#define GLFW_KEY_F10 (GLFW_KEY_SPECIAL + 11)
89-
#define GLFW_KEY_F11 (GLFW_KEY_SPECIAL + 12)
90-
#define GLFW_KEY_F12 (GLFW_KEY_SPECIAL + 13)
91-
#define GLFW_KEY_F13 (GLFW_KEY_SPECIAL + 14)
92-
#define GLFW_KEY_F14 (GLFW_KEY_SPECIAL + 15)
93-
#define GLFW_KEY_F15 (GLFW_KEY_SPECIAL + 16)
94-
#define GLFW_KEY_F16 (GLFW_KEY_SPECIAL + 17)
95-
#define GLFW_KEY_F17 (GLFW_KEY_SPECIAL + 18)
96-
#define GLFW_KEY_F18 (GLFW_KEY_SPECIAL + 19)
97-
#define GLFW_KEY_F19 (GLFW_KEY_SPECIAL + 20)
98-
#define GLFW_KEY_F20 (GLFW_KEY_SPECIAL + 21)
99-
#define GLFW_KEY_F21 (GLFW_KEY_SPECIAL + 22)
100-
#define GLFW_KEY_F22 (GLFW_KEY_SPECIAL + 23)
101-
#define GLFW_KEY_F23 (GLFW_KEY_SPECIAL + 24)
102-
#define GLFW_KEY_F24 (GLFW_KEY_SPECIAL + 25)
103-
#define GLFW_KEY_F25 (GLFW_KEY_SPECIAL + 26)
104-
#define GLFW_KEY_UP (GLFW_KEY_SPECIAL + 27)
105-
#define GLFW_KEY_DOWN (GLFW_KEY_SPECIAL + 28)
106-
#define GLFW_KEY_LEFT (GLFW_KEY_SPECIAL + 29)
107-
#define GLFW_KEY_RIGHT (GLFW_KEY_SPECIAL + 30)
108-
#define GLFW_KEY_LSHIFT (GLFW_KEY_SPECIAL + 31)
109-
#define GLFW_KEY_RSHIFT (GLFW_KEY_SPECIAL + 32)
110-
#define GLFW_KEY_LCTRL (GLFW_KEY_SPECIAL + 33)
111-
#define GLFW_KEY_RCTRL (GLFW_KEY_SPECIAL + 34)
112-
#define GLFW_KEY_LALT (GLFW_KEY_SPECIAL + 35)
113-
#define GLFW_KEY_RALT (GLFW_KEY_SPECIAL + 36)
114-
#define GLFW_KEY_TAB (GLFW_KEY_SPECIAL + 37)
115-
#define GLFW_KEY_ENTER (GLFW_KEY_SPECIAL + 38)
116-
#define GLFW_KEY_BACKSPACE (GLFW_KEY_SPECIAL + 39)
117-
#define GLFW_KEY_INSERT (GLFW_KEY_SPECIAL + 40)
118-
#define GLFW_KEY_DEL (GLFW_KEY_SPECIAL + 41)
119-
#define GLFW_KEY_PAGEUP (GLFW_KEY_SPECIAL + 42)
120-
#define GLFW_KEY_PAGEDOWN (GLFW_KEY_SPECIAL + 43)
121-
#define GLFW_KEY_HOME (GLFW_KEY_SPECIAL + 44)
122-
#define GLFW_KEY_END (GLFW_KEY_SPECIAL + 45)
123-
#define GLFW_KEY_KP_0 (GLFW_KEY_SPECIAL + 46)
124-
#define GLFW_KEY_KP_1 (GLFW_KEY_SPECIAL + 47)
125-
#define GLFW_KEY_KP_2 (GLFW_KEY_SPECIAL + 48)
126-
#define GLFW_KEY_KP_3 (GLFW_KEY_SPECIAL + 49)
127-
#define GLFW_KEY_KP_4 (GLFW_KEY_SPECIAL + 50)
128-
#define GLFW_KEY_KP_5 (GLFW_KEY_SPECIAL + 51)
129-
#define GLFW_KEY_KP_6 (GLFW_KEY_SPECIAL + 52)
130-
#define GLFW_KEY_KP_7 (GLFW_KEY_SPECIAL + 53)
131-
#define GLFW_KEY_KP_8 (GLFW_KEY_SPECIAL + 54)
132-
#define GLFW_KEY_KP_9 (GLFW_KEY_SPECIAL + 55)
133-
#define GLFW_KEY_KP_DIVIDE (GLFW_KEY_SPECIAL + 56)
134-
#define GLFW_KEY_KP_MULTIPLY (GLFW_KEY_SPECIAL + 57)
135-
#define GLFW_KEY_KP_SUBTRACT (GLFW_KEY_SPECIAL + 58)
136-
#define GLFW_KEY_KP_ADD (GLFW_KEY_SPECIAL + 59)
137-
#define GLFW_KEY_KP_DECIMAL (GLFW_KEY_SPECIAL + 60)
138-
#define GLFW_KEY_KP_EQUAL (GLFW_KEY_SPECIAL + 61)
139-
#define GLFW_KEY_KP_ENTER (GLFW_KEY_SPECIAL + 62)
140-
#define GLFW_KEY_KP_NUM_LOCK (GLFW_KEY_SPECIAL + 63)
141-
#define GLFW_KEY_CAPS_LOCK (GLFW_KEY_SPECIAL + 64)
142-
#define GLFW_KEY_SCROLL_LOCK (GLFW_KEY_SPECIAL + 65)
143-
#define GLFW_KEY_PAUSE (GLFW_KEY_SPECIAL + 66)
144-
#define GLFW_KEY_LSUPER (GLFW_KEY_SPECIAL + 67)
145-
#define GLFW_KEY_RSUPER (GLFW_KEY_SPECIAL + 68)
146-
#define GLFW_KEY_MENU (GLFW_KEY_SPECIAL + 69)
147-
#define GLFW_KEY_LAST GLFW_KEY_MENU
78+
const GLFW_KEY_ESC = GLFW_KEY_SPECIAL + 1
79+
const GLFW_KEY_F1 = GLFW_KEY_SPECIAL + 2
80+
const GLFW_KEY_F2 = GLFW_KEY_SPECIAL + 3
81+
const GLFW_KEY_F3 = GLFW_KEY_SPECIAL + 4
82+
const GLFW_KEY_F4 = GLFW_KEY_SPECIAL + 5
83+
const GLFW_KEY_F5 = GLFW_KEY_SPECIAL + 6
84+
const GLFW_KEY_F6 = GLFW_KEY_SPECIAL + 7
85+
const GLFW_KEY_F7 = GLFW_KEY_SPECIAL + 8
86+
const GLFW_KEY_F8 = GLFW_KEY_SPECIAL + 9
87+
const GLFW_KEY_F9 = GLFW_KEY_SPECIAL + 10
88+
const GLFW_KEY_F10 = GLFW_KEY_SPECIAL + 11
89+
const GLFW_KEY_F11 = GLFW_KEY_SPECIAL + 12
90+
const GLFW_KEY_F12 = GLFW_KEY_SPECIAL + 13
91+
const GLFW_KEY_F13 = GLFW_KEY_SPECIAL + 14
92+
const GLFW_KEY_F14 = GLFW_KEY_SPECIAL + 15
93+
const GLFW_KEY_F15 = GLFW_KEY_SPECIAL + 16
94+
const GLFW_KEY_F16 = GLFW_KEY_SPECIAL + 17
95+
const GLFW_KEY_F17 = GLFW_KEY_SPECIAL + 18
96+
const GLFW_KEY_F18 = GLFW_KEY_SPECIAL + 19
97+
const GLFW_KEY_F19 = GLFW_KEY_SPECIAL + 20
98+
const GLFW_KEY_F20 = GLFW_KEY_SPECIAL + 21
99+
const GLFW_KEY_F21 = GLFW_KEY_SPECIAL + 22
100+
const GLFW_KEY_F22 = GLFW_KEY_SPECIAL + 23
101+
const GLFW_KEY_F23 = GLFW_KEY_SPECIAL + 24
102+
const GLFW_KEY_F24 = GLFW_KEY_SPECIAL + 25
103+
const GLFW_KEY_F25 = GLFW_KEY_SPECIAL + 26
104+
const GLFW_KEY_UP = GLFW_KEY_SPECIAL + 27
105+
const GLFW_KEY_DOWN = GLFW_KEY_SPECIAL + 28
106+
const GLFW_KEY_LEFT = GLFW_KEY_SPECIAL + 29
107+
const GLFW_KEY_RIGHT = GLFW_KEY_SPECIAL + 30
108+
const GLFW_KEY_LSHIFT = GLFW_KEY_SPECIAL + 31
109+
const GLFW_KEY_RSHIFT = GLFW_KEY_SPECIAL + 32
110+
const GLFW_KEY_LCTRL = GLFW_KEY_SPECIAL + 33
111+
const GLFW_KEY_RCTRL = GLFW_KEY_SPECIAL + 34
112+
const GLFW_KEY_LALT = GLFW_KEY_SPECIAL + 35
113+
const GLFW_KEY_RALT = GLFW_KEY_SPECIAL + 36
114+
const GLFW_KEY_TAB = GLFW_KEY_SPECIAL + 37
115+
const GLFW_KEY_ENTER = GLFW_KEY_SPECIAL + 38
116+
const GLFW_KEY_BACKSPACE = GLFW_KEY_SPECIAL + 39
117+
const GLFW_KEY_INSERT = GLFW_KEY_SPECIAL + 40
118+
const GLFW_KEY_DEL = GLFW_KEY_SPECIAL + 41
119+
const GLFW_KEY_PAGEUP = GLFW_KEY_SPECIAL + 42
120+
const GLFW_KEY_PAGEDOWN = GLFW_KEY_SPECIAL + 43
121+
const GLFW_KEY_HOME = GLFW_KEY_SPECIAL + 44
122+
const GLFW_KEY_END = GLFW_KEY_SPECIAL + 45
123+
const GLFW_KEY_KP_0 = GLFW_KEY_SPECIAL + 46
124+
const GLFW_KEY_KP_1 = GLFW_KEY_SPECIAL + 47
125+
const GLFW_KEY_KP_2 = GLFW_KEY_SPECIAL + 48
126+
const GLFW_KEY_KP_3 = GLFW_KEY_SPECIAL + 49
127+
const GLFW_KEY_KP_4 = GLFW_KEY_SPECIAL + 50
128+
const GLFW_KEY_KP_5 = GLFW_KEY_SPECIAL + 51
129+
const GLFW_KEY_KP_6 = GLFW_KEY_SPECIAL + 52
130+
const GLFW_KEY_KP_7 = GLFW_KEY_SPECIAL + 53
131+
const GLFW_KEY_KP_8 = GLFW_KEY_SPECIAL + 54
132+
const GLFW_KEY_KP_9 = GLFW_KEY_SPECIAL + 55
133+
const GLFW_KEY_KP_DIVIDE = GLFW_KEY_SPECIAL + 56
134+
const GLFW_KEY_KP_MULTIPLY = GLFW_KEY_SPECIAL + 57
135+
const GLFW_KEY_KP_SUBTRACT = GLFW_KEY_SPECIAL + 58
136+
const GLFW_KEY_KP_ADD = GLFW_KEY_SPECIAL + 59
137+
const GLFW_KEY_KP_DECIMAL = GLFW_KEY_SPECIAL + 60
138+
const GLFW_KEY_KP_EQUAL = GLFW_KEY_SPECIAL + 61
139+
const GLFW_KEY_KP_ENTER = GLFW_KEY_SPECIAL + 62
140+
const GLFW_KEY_KP_NUM_LOCK = GLFW_KEY_SPECIAL + 63
141+
const GLFW_KEY_CAPS_LOCK = GLFW_KEY_SPECIAL + 64
142+
const GLFW_KEY_SCROLL_LOCK = GLFW_KEY_SPECIAL + 65
143+
const GLFW_KEY_PAUSE = GLFW_KEY_SPECIAL + 66
144+
const GLFW_KEY_LSUPER = GLFW_KEY_SPECIAL + 67
145+
const GLFW_KEY_RSUPER = GLFW_KEY_SPECIAL + 68
146+
const GLFW_KEY_MENU = GLFW_KEY_SPECIAL + 69
147+
const GLFW_KEY_LAST = GLFW_KEY_MENU
148148
const GLFW_MOUSE_BUTTON_1 = 0
149149
const GLFW_MOUSE_BUTTON_2 = 1
150150
const GLFW_MOUSE_BUTTON_3 = 2

Diff for: inc/Lua/lauxlib.bi

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
extern "C"
3535

3636
#define lauxlib_h
37-
#define LUA_ERRFILE (LUA_ERRERR + 1)
37+
const LUA_ERRFILE = LUA_ERRERR + 1
3838

3939
type luaL_Reg
4040
name as const zstring ptr

Diff for: inc/Lua/lua.bi

+6-6
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343

4444
'' The following symbols have been renamed:
4545
'' typedef LUA_NUMBER => LUA_NUMBER_
46-
'' typedef LUA_UNSIGNED => LUA_UNSIGNED_
4746
'' typedef LUA_INTEGER => LUA_INTEGER_
47+
'' typedef LUA_UNSIGNED => LUA_UNSIGNED_
4848
'' typedef LUA_KCONTEXT => LUA_KCONTEXT_
4949
'' #define LUA_VERSION => LUA_VERSION_
5050
'' constant LUA_YIELD => LUA_YIELD_
@@ -181,7 +181,7 @@ const LUA_VERSION_NUM = 503
181181
#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo, W. Celes"
182182
#define LUA_SIGNATURE !"\27Lua"
183183
const LUA_MULTRET = -1
184-
#define LUA_REGISTRYINDEX ((-LUAI_MAXSTACK) - 1000)
184+
const LUA_REGISTRYINDEX = (-LUAI_MAXSTACK) - 1000
185185
#define lua_upvalueindex(i) (LUA_REGISTRYINDEX - (i))
186186
const LUA_OK = 0
187187
const LUA_YIELD_ = 1
@@ -388,10 +388,10 @@ const LUA_HOOKRET = 1
388388
const LUA_HOOKLINE = 2
389389
const LUA_HOOKCOUNT = 3
390390
const LUA_HOOKTAILCALL = 4
391-
#define LUA_MASKCALL (1 shl LUA_HOOKCALL)
392-
#define LUA_MASKRET (1 shl LUA_HOOKRET)
393-
#define LUA_MASKLINE (1 shl LUA_HOOKLINE)
394-
#define LUA_MASKCOUNT (1 shl LUA_HOOKCOUNT)
391+
const LUA_MASKCALL = 1 shl LUA_HOOKCALL
392+
const LUA_MASKRET = 1 shl LUA_HOOKRET
393+
const LUA_MASKLINE = 1 shl LUA_HOOKLINE
394+
const LUA_MASKCOUNT = 1 shl LUA_HOOKCOUNT
395395
type lua_Debug as lua_Debug_
396396
type lua_Hook as sub(byval L as lua_State ptr, byval ar as lua_Debug ptr)
397397

Diff for: inc/SDL/SDL.bi

+9-9
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ const SDL_BYTEORDER = SDL_LIL_ENDIAN
291291
#define SDL_SwapBE64(X) SDL_Swap64(X)
292292
#define _SDL_mutex_h
293293
const SDL_MUTEX_TIMEDOUT = 1
294-
#define SDL_MUTEX_MAXWAIT (not cast(Uint32, 0))
294+
const SDL_MUTEX_MAXWAIT = not cast(Uint32, 0)
295295
type SDL_mutex as SDL_mutex_
296296
declare function SDL_CreateMutex() as SDL_mutex ptr
297297
#define SDL_LockMutex(m) SDL_mutexP(m)
@@ -793,10 +793,10 @@ enum
793793
KMOD_RESERVED = &h8000
794794
end enum
795795

796-
#define KMOD_CTRL (KMOD_LCTRL or KMOD_RCTRL)
797-
#define KMOD_SHIFT (KMOD_LSHIFT or KMOD_RSHIFT)
798-
#define KMOD_ALT (KMOD_LALT or KMOD_RALT)
799-
#define KMOD_META (KMOD_LMETA or KMOD_RMETA)
796+
const KMOD_CTRL = KMOD_LCTRL or KMOD_RCTRL
797+
const KMOD_SHIFT = KMOD_LSHIFT or KMOD_RSHIFT
798+
const KMOD_ALT = KMOD_LALT or KMOD_RALT
799+
const KMOD_META = KMOD_LMETA or KMOD_RMETA
800800

801801
type SDL_keysym
802802
scancode as Uint8
@@ -1090,10 +1090,10 @@ const SDL_HAT_UP = &h01
10901090
const SDL_HAT_RIGHT = &h02
10911091
const SDL_HAT_DOWN = &h04
10921092
const SDL_HAT_LEFT = &h08
1093-
#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT or SDL_HAT_UP)
1094-
#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT or SDL_HAT_DOWN)
1095-
#define SDL_HAT_LEFTUP (SDL_HAT_LEFT or SDL_HAT_UP)
1096-
#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT or SDL_HAT_DOWN)
1093+
const SDL_HAT_RIGHTUP = SDL_HAT_RIGHT or SDL_HAT_UP
1094+
const SDL_HAT_RIGHTDOWN = SDL_HAT_RIGHT or SDL_HAT_DOWN
1095+
const SDL_HAT_LEFTUP = SDL_HAT_LEFT or SDL_HAT_UP
1096+
const SDL_HAT_LEFTDOWN = SDL_HAT_LEFT or SDL_HAT_DOWN
10971097

10981098
declare function SDL_JoystickGetHat(byval joystick as SDL_Joystick ptr, byval hat as long) as Uint8
10991099
declare function SDL_JoystickGetBall(byval joystick as SDL_Joystick ptr, byval ball as long, byval dx as long ptr, byval dy as long ptr) as long

Diff for: inc/SDL2/SDL.bi

+12-12
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ end function
348348
#define SDL_SwapFloatBE(X) SDL_SwapFloat(X)
349349
#define _SDL_mutex_h
350350
const SDL_MUTEX_TIMEDOUT = 1
351-
#define SDL_MUTEX_MAXWAIT (not cast(Uint32, 0))
351+
const SDL_MUTEX_MAXWAIT = not cast(Uint32, 0)
352352
type SDL_mutex as SDL_mutex_
353353
declare function SDL_CreateMutex() as SDL_mutex ptr
354354
#define SDL_mutexP(m) SDL_LockMutex(m)
@@ -558,7 +558,7 @@ const AUDIO_F32SYS = AUDIO_F32LSB
558558
const SDL_AUDIO_ALLOW_FREQUENCY_CHANGE = &h00000001
559559
const SDL_AUDIO_ALLOW_FORMAT_CHANGE = &h00000002
560560
const SDL_AUDIO_ALLOW_CHANNELS_CHANGE = &h00000004
561-
#define SDL_AUDIO_ALLOW_ANY_CHANGE ((SDL_AUDIO_ALLOW_FREQUENCY_CHANGE or SDL_AUDIO_ALLOW_FORMAT_CHANGE) or SDL_AUDIO_ALLOW_CHANNELS_CHANGE)
561+
const SDL_AUDIO_ALLOW_ANY_CHANGE = (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE or SDL_AUDIO_ALLOW_FORMAT_CHANGE) or SDL_AUDIO_ALLOW_CHANNELS_CHANGE
562562
type SDL_AudioCallback as sub(byval userdata as any ptr, byval stream as Uint8 ptr, byval len as long)
563563

564564
type SDL_AudioSpec
@@ -1588,10 +1588,10 @@ enum
15881588
KMOD_RESERVED = &h8000
15891589
end enum
15901590

1591-
#define KMOD_CTRL (KMOD_LCTRL or KMOD_RCTRL)
1592-
#define KMOD_SHIFT (KMOD_LSHIFT or KMOD_RSHIFT)
1593-
#define KMOD_ALT (KMOD_LALT or KMOD_RALT)
1594-
#define KMOD_GUI (KMOD_LGUI or KMOD_RGUI)
1591+
const KMOD_CTRL = KMOD_LCTRL or KMOD_RCTRL
1592+
const KMOD_SHIFT = KMOD_LSHIFT or KMOD_RSHIFT
1593+
const KMOD_ALT = KMOD_LALT or KMOD_RALT
1594+
const KMOD_GUI = KMOD_LGUI or KMOD_RGUI
15951595

15961596
type SDL_Keysym
15971597
scancode as SDL_Scancode
@@ -1693,10 +1693,10 @@ const SDL_HAT_UP = &h01
16931693
const SDL_HAT_RIGHT = &h02
16941694
const SDL_HAT_DOWN = &h04
16951695
const SDL_HAT_LEFT = &h08
1696-
#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT or SDL_HAT_UP)
1697-
#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT or SDL_HAT_DOWN)
1698-
#define SDL_HAT_LEFTUP (SDL_HAT_LEFT or SDL_HAT_UP)
1699-
#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT or SDL_HAT_DOWN)
1696+
const SDL_HAT_RIGHTUP = SDL_HAT_RIGHT or SDL_HAT_UP
1697+
const SDL_HAT_RIGHTDOWN = SDL_HAT_RIGHT or SDL_HAT_DOWN
1698+
const SDL_HAT_LEFTUP = SDL_HAT_LEFT or SDL_HAT_UP
1699+
const SDL_HAT_LEFTDOWN = SDL_HAT_LEFT or SDL_HAT_DOWN
17001700

17011701
declare function SDL_JoystickGetHat(byval joystick as SDL_Joystick ptr, byval hat as long) as Uint8
17021702
declare function SDL_JoystickGetBall(byval joystick as SDL_Joystick ptr, byval ball as long, byval dx as long ptr, byval dy as long ptr) as long
@@ -1800,7 +1800,7 @@ type SDL_Finger
18001800
pressure as single
18011801
end type
18021802

1803-
#define SDL_TOUCH_MOUSEID cast(Uint32, -1)
1803+
const SDL_TOUCH_MOUSEID = cast(Uint32, -1)
18041804
declare function SDL_GetNumTouchDevices() as long
18051805
declare function SDL_GetTouchDevice(byval index as long) as SDL_TouchID
18061806
declare function SDL_GetNumTouchFingers(byval touchID as SDL_TouchID) as long
@@ -2623,7 +2623,7 @@ const SDL_INIT_HAPTIC = &h00001000
26232623
const SDL_INIT_GAMECONTROLLER = &h00002000
26242624
const SDL_INIT_EVENTS = &h00004000
26252625
const SDL_INIT_NOPARACHUTE = &h00100000
2626-
#define SDL_INIT_EVERYTHING ((((((SDL_INIT_TIMER or SDL_INIT_AUDIO) or SDL_INIT_VIDEO) or SDL_INIT_EVENTS) or SDL_INIT_JOYSTICK) or SDL_INIT_HAPTIC) or SDL_INIT_GAMECONTROLLER)
2626+
const SDL_INIT_EVERYTHING = (((((SDL_INIT_TIMER or SDL_INIT_AUDIO) or SDL_INIT_VIDEO) or SDL_INIT_EVENTS) or SDL_INIT_JOYSTICK) or SDL_INIT_HAPTIC) or SDL_INIT_GAMECONTROLLER
26272627

26282628
declare function SDL_Init(byval flags as Uint32) as long
26292629
declare function SDL_InitSubSystem(byval flags as Uint32) as long

Diff for: inc/X11/Intrinsic.bi

+6-6
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ declare sub XtTranslateKey(byval as Display ptr, byval as KeyCode, byval as Modi
296296
declare sub XtSetKeyTranslator(byval as Display ptr, byval as XtKeyProc)
297297
declare sub XtRegisterCaseConverter(byval as Display ptr, byval as XtCaseProc, byval as KeySym, byval as KeySym)
298298
declare sub XtConvertCase(byval as Display ptr, byval as KeySym, byval as KeySym ptr, byval as KeySym ptr)
299-
#define XtAllEvents cast(EventMask, -cast(clong, 1))
299+
const XtAllEvents = cast(EventMask, -cast(clong, 1))
300300
declare sub XtAddEventHandler(byval as Widget, byval as EventMask, byval as byte, byval as XtEventHandler, byval as XtPointer)
301301
declare sub XtRemoveEventHandler(byval as Widget, byval as EventMask, byval as byte, byval as XtEventHandler, byval as XtPointer)
302302
declare sub XtAddRawEventHandler(byval as Widget, byval as EventMask, byval as byte, byval as XtEventHandler, byval as XtPointer)
@@ -337,7 +337,7 @@ const XtIMXEvent = 1
337337
const XtIMTimer = 2
338338
const XtIMAlternateInput = 4
339339
const XtIMSignal = 8
340-
#define XtIMAll (((XtIMXEvent or XtIMTimer) or XtIMAlternateInput) or XtIMSignal)
340+
const XtIMAll = ((XtIMXEvent or XtIMTimer) or XtIMAlternateInput) or XtIMSignal
341341

342342
declare function XtPending() as byte
343343
declare function XtAppPending(byval as XtAppContext) as XtInputMask
@@ -461,10 +461,10 @@ declare sub XtVaGetSubvalues(byval as XtPointer, byval as XtResourceList, byval
461461
declare sub XtGetResourceList(byval as WidgetClass, byval as XtResourceList ptr, byval as Cardinal ptr)
462462
declare sub XtGetConstraintResourceList(byval as WidgetClass, byval as XtResourceList ptr, byval as Cardinal ptr)
463463

464-
#define XtUnspecifiedPixmap cast(Pixmap, 2)
464+
const XtUnspecifiedPixmap = cast(Pixmap, 2)
465465
const XtUnspecifiedShellInt = -1
466-
#define XtUnspecifiedWindow cast(Window, 2)
467-
#define XtUnspecifiedWindowGroup cast(Window, 3)
466+
const XtUnspecifiedWindow = cast(Window, 2)
467+
const XtUnspecifiedWindowGroup = cast(Window, 3)
468468
#define XtCurrentDirectory "XtCurrentDirectory"
469469
#define XtDefaultForeground "XtDefaultForeground"
470470
#define XtDefaultBackground "XtDefaultBackground"
@@ -534,7 +534,7 @@ declare sub XtCallbackReleaseCacheRefList(byval as Widget, byval as XtPointer, b
534534
declare sub XtSetWMColormapWindows(byval as Widget, byval as Widget ptr, byval as Cardinal)
535535
declare function XtFindFile(byval as const zstring ptr, byval as Substitution, byval as Cardinal, byval as XtFilePredicate) as String_
536536
declare function XtResolvePathname(byval as Display ptr, byval as const zstring ptr, byval as const zstring ptr, byval as const zstring ptr, byval as const zstring ptr, byval as Substitution, byval as Cardinal, byval as XtFilePredicate) as String_
537-
#define XT_CONVERT_FAIL cast(XAtom, &h80000001)
537+
const XT_CONVERT_FAIL = cast(XAtom, &h80000001)
538538
declare sub XtDisownSelection(byval as Widget, byval as XAtom, byval as Time)
539539
declare sub XtGetSelectionValue(byval as Widget, byval as XAtom, byval as XAtom, byval as XtSelectionCallbackProc, byval as XtPointer, byval as Time)
540540
declare sub XtGetSelectionValues(byval as Widget, byval as XAtom, byval as XAtom ptr, byval as long, byval as XtSelectionCallbackProc, byval as XtPointer ptr, byval as Time)

Diff for: inc/X11/IntrinsicP.bi

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ type XrmResourceList as XrmResource ptr
7474
type XtVersionType as culong
7575
const XT_VERSION = 11
7676
const XT_REVISION = 6
77-
#define XtVersion ((XT_VERSION * 1000) + XT_REVISION)
77+
const XtVersion = (XT_VERSION * 1000) + XT_REVISION
7878
const XtVersionDontCheck = 0
7979

8080
type XtProc as sub()

Diff for: inc/X11/TranslateI.bi

+2-2
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ type _TMConvertRec
287287
end type
288288

289289
type TMConvertRec as _TMConvertRec
290-
#define _XtEventTimerEventType cast(TMLongCard, not cast(clong, 0))
290+
const _XtEventTimerEventType = cast(TMLongCard, not cast(clong, 0))
291291
const KeysymModMask = cast(clong, 1) shl 27
292292
const AnyButtonMask = cast(clong, 1) shl 28
293293

@@ -333,7 +333,7 @@ end type
333333
type ActionHookRec as _ActionHookRec
334334
type ActionHook as _ActionHookRec ptr
335335
const TMKEYCACHELOG2 = 6
336-
#define TMKEYCACHESIZE (1 shl TMKEYCACHELOG2)
336+
const TMKEYCACHESIZE = 1 shl TMKEYCACHELOG2
337337

338338
type _KeyCacheRec
339339
modifiers_return(0 to 255) as ubyte

Diff for: inc/X11/X.bi

+2-2
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ const SyncKeyboard = 4
223223
const ReplayKeyboard = 5
224224
const AsyncBoth = 6
225225
const SyncBoth = 7
226-
#define RevertToNone clng(None)
227-
#define RevertToPointerRoot clng(PointerRoot)
226+
const RevertToNone = clng(None)
227+
const RevertToPointerRoot = clng(PointerRoot)
228228
const RevertToParent = 2
229229
const Success = 0
230230
const BadRequest = 1

0 commit comments

Comments
 (0)