summary refs log tree commit diff stats
path: root/tests/accept/compile/tforwty2.nim
blob: 5d15e112ae1cb089cf4eed0388c9869b0d37ea43 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Test for a hard to fix internal error
# occured in the SDL library

{.push dynlib: "SDL.dll", callconv: cdecl.}

type
  PSDL_semaphore = ptr TSDL_semaphore
  TSDL_semaphore {.final.} = object
    sem: Pointer             #PSem_t;
    when not defined(USE_NAMED_SEMAPHORES):
      sem_data: int
    when defined(BROKEN_SEMGETVALUE):
      # This is a little hack for MacOS X -
      # It's not thread-safe, but it's better than nothing
      sem_value: cint

type
  PSDL_Sem = ptr TSDL_Sem
  TSDL_Sem = TSDL_Semaphore

proc SDL_CreateSemaphore(initial_value: Int32): PSDL_Sem {.
  importc: "SDL_CreateSemaphore".}