aboutsummaryrefslogtreecommitdiff
path: root/sdl2/joystick.ha
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2021-12-10 09:42:10 +0100
committerDrew DeVault <sir@cmpwn.com>2021-12-10 09:44:50 +0100
commit9607eb0de784fab1a99833f567c0eaca72b67e4a (patch)
tree7f79a0914a6db1d963d877bed051f6856c54cfa8 /sdl2/joystick.ha
parentMakefile: drop -T+libc (diff)
downloadhare-chip8-9607eb0de784fab1a99833f567c0eaca72b67e4a.tar.gz
all: rig up Hare-native error handling
Diffstat (limited to 'sdl2/joystick.ha')
-rw-r--r--sdl2/joystick.ha9
1 files changed, 4 insertions, 5 deletions
diff --git a/sdl2/joystick.ha b/sdl2/joystick.ha
index c4f4c96..adbcd14 100644
--- a/sdl2/joystick.ha
+++ b/sdl2/joystick.ha
@@ -6,8 +6,7 @@ export def JOYSTICK_AXIS_MIN: i16 = -32768;
// Minimum value for a joystick axis.
export def JOYSTICK_AXIS_MAX: i16 = 32767;
-// Count the number of joysticks attached to the system.
-//
-// Returns the number of attached joysticks on success or a negative error code
-// on failure.
-export @symbol("SDL_NumJoysticks") fn numjoysticks() int;
+@symbol("SDL_NumJoysticks") fn _numjoysticks() int;
+
+// Returns the number of joysticks attached to the system.
+export fn numjoysticks() (int | error) = wrapint(_numjoysticks());