aboutsummaryrefslogtreecommitdiff
path: root/sdl2/errors.ha
diff options
context:
space:
mode:
Diffstat (limited to 'sdl2/errors.ha')
-rw-r--r--sdl2/errors.ha31
1 files changed, 0 insertions, 31 deletions
diff --git a/sdl2/errors.ha b/sdl2/errors.ha
deleted file mode 100644
index a848667..0000000
--- a/sdl2/errors.ha
+++ /dev/null
@@ -1,31 +0,0 @@
-use types::c;
-
-// Returned when an error occurs in an SDL function.
-export type error = !str;
-
-// Converts an SDL error into a human-friendly string.
-export fn strerror(err: error) str = {
- return err: str;
-};
-
-@symbol("SDL_GetError") fn SDL_GetError() const *c::char;
-
-export fn wrapvoid(ret: int) (void | error) = {
- wrapint(ret)?;
-};
-
-export fn wrapint(ret: int) (int | error) = {
- if (ret < 0) {
- return c::tostr(SDL_GetError()): error;
- };
- return ret;
-};
-
-export fn wrapptr(ret: nullable *opaque) (*opaque | error) = {
- match (ret) {
- case let v: *opaque =>
- return v;
- case null =>
- return c::tostr(SDL_GetError()): error;
- };
-};