phoboslab / qoi

The “Quite OK Image Format” for fast, lossless image compression
MIT License
6.92k stars 331 forks source link

qoibench: Tweak the high resolution timer for use with OpenBSD/other POSIX systems. #115

Closed fagg closed 2 years ago

fagg commented 2 years ago
  1. Makes qoibench compile on OpenBSD (with clang) - further PR required to get it 100% working - which will follow.
  2. Slight refactor to how the timer resolution is configured. Change to use WIN32_LEAN_AND_MEAN, HAVE_POSIX_TIMER and HAVE_MACH_TIMER in the ns() function, rather than using the __linux etc. This makes a bit more sense since that ns() function can be generic based on the type of timer, not the actual system being targeted. Now, if someone wants to add support for other POSIX systems, most likely it'll just require a one line change to get both the required #include directives and the appropriate timer logic compiled in.