Skip to content

Commit

Permalink
platform: add WindowsMessageHook type to silence Windows build noti…
Browse files Browse the repository at this point in the history
…ce (vlang#726)
  • Loading branch information
larpon authored Feb 6, 2024
1 parent e0a6bff commit d6e006c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions system_windows.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@ module sdl

// Platform specific functions for Windows

fn C.SDL_SetWindowsMessageHook(callback C.SDL_WindowsMessageHook, userdata voidptr)
// WindowsMessageHook is `typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam)`
pub type WindowsMessageHook = fn (userdata voidptr, h_wnd voidptr, message u32, w_param u64, l_param i64)

fn C.SDL_SetWindowsMessageHook(callback WindowsMessageHook, userdata voidptr)

// set_windows_message_hook sets a callback for every Windows message, run before TranslateMessage().
//
// `callback` The SDL_WindowsMessageHook function to call.
// `userdata` a pointer to pass to every iteration of `callback`
//
// NOTE This function is available since SDL 2.0.4.
pub fn set_windows_message_hook(callback C.SDL_WindowsMessageHook, userdata voidptr) {
pub fn set_windows_message_hook(callback WindowsMessageHook, userdata voidptr) {
C.SDL_SetWindowsMessageHook(callback, userdata)
}

Expand Down

0 comments on commit d6e006c

Please sign in to comment.