diff options
Diffstat (limited to 'tests/niminaction/Chapter8')
-rw-r--r-- | tests/niminaction/Chapter8/sdl/sdl.nim | 10 | ||||
-rw-r--r-- | tests/niminaction/Chapter8/sdl/sdl_test.nim | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/tests/niminaction/Chapter8/sdl/sdl.nim b/tests/niminaction/Chapter8/sdl/sdl.nim index a1b30281b..212f7b022 100644 --- a/tests/niminaction/Chapter8/sdl/sdl.nim +++ b/tests/niminaction/Chapter8/sdl/sdl.nim @@ -1,9 +1,13 @@ -when defined(Windows): +when defined(windows): const libName* = "SDL2.dll" -elif defined(Linux): +elif defined(linux) or defined(freebsd) or defined(netbsd): const libName* = "libSDL2.so" -elif defined(MacOsX): +elif defined(macosx): const libName* = "libSDL2.dylib" +elif defined(openbsd): + const libName* = "libSDL2.so.0.6" +else: + {.error: "SDL library name not set for this platform".} type SdlWindow = object diff --git a/tests/niminaction/Chapter8/sdl/sdl_test.nim b/tests/niminaction/Chapter8/sdl/sdl_test.nim index 1c4d258fb..db1700e0d 100644 --- a/tests/niminaction/Chapter8/sdl/sdl_test.nim +++ b/tests/niminaction/Chapter8/sdl/sdl_test.nim @@ -18,7 +18,7 @@ renderer.setDrawColor 29, 64, 153, 255 renderer.clear renderer.setDrawColor 255, 255, 255, 255 -when defined(c): +when false: # no long work with gcc 14! # just to ensure code from NimInAction still works, but # the `else` branch would work as well in C mode var points = [ |