mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-19 17:38:34 +00:00
fix sdl_test test that failed in CI cpp mode (#10314)
* fix sdl_test test that failed in CI cpp mode * preserve old code for NimInAction in `nim c` mode
This commit is contained in:
@@ -17,12 +17,24 @@ discard pollEvent(nil)
|
||||
renderer.setDrawColor 29, 64, 153, 255
|
||||
renderer.clear
|
||||
renderer.setDrawColor 255, 255, 255, 255
|
||||
var points = [
|
||||
(260'i32, 320'i32),
|
||||
(260'i32, 110'i32),
|
||||
(360'i32, 320'i32),
|
||||
(360'i32, 110'i32)
|
||||
]
|
||||
|
||||
when defined(c):
|
||||
# just to ensure code from NimInAction still works, but
|
||||
# the `else` branch would work as well in C mode
|
||||
var points = [
|
||||
(260'i32, 320'i32),
|
||||
(260'i32, 110'i32),
|
||||
(360'i32, 320'i32),
|
||||
(360'i32, 110'i32)
|
||||
]
|
||||
else:
|
||||
var points = [
|
||||
(260.cint, 320.cint),
|
||||
(260.cint, 110.cint),
|
||||
(360.cint, 320.cint),
|
||||
(360.cint, 110.cint)
|
||||
]
|
||||
|
||||
renderer.drawLines(addr points[0], points.len.cint)
|
||||
|
||||
renderer.present
|
||||
|
||||
Reference in New Issue
Block a user