tforwty2.nim 616 B

1234567891011121314151617181920212223
  1. # Test for a hard to fix internal error
  2. # occurred in the SDL library
  3. {.push dynlib: "SDL.dll", callconv: cdecl.}
  4. type
  5. PSDL_semaphore = ptr TSDL_semaphore
  6. TSDL_semaphore {.final.} = object
  7. sem: pointer #PSem_t;
  8. when not defined(USE_NAMED_SEMAPHORES):
  9. sem_data: int
  10. when defined(BROKEN_SEMGETVALUE):
  11. # This is a little hack for MacOS X -
  12. # It's not thread-safe, but it's better than nothing
  13. sem_value: cint
  14. type
  15. PSDL_Sem = ptr TSDL_Sem
  16. TSDL_Sem = TSDL_Semaphore
  17. proc SDL_CreateSemaphore(initial_value: int32): PSDL_Sem {.
  18. importc: "SDL_CreateSemaphore".}