gbdev / rgbds

Rednex Game Boy Development System - An assembly toolchain for the Nintendo Game Boy and Game Boy Color
https://rgbds.gbdev.io
MIT License
1.33k stars 171 forks source link

Move definition of `_POSIX_C_SOURCE` to include/platform.hpp #1524

Closed Rangi42 closed 4 days ago

Rangi42 commented 4 days ago

Fixes #1111

This is how https://github.com/google/flatbuffers/pull/6205 and https://github.com/WebAssembly/wabt/pull/1360 dealt with the problem. (Defining _POSIX_C_SOURCE is required on some platforms, like Cygwin, and breaks others, like BSD. CMake makes platform detection easy, but POSIX Make does not, which leaves in-source definition.)

This works in OpenBSD 7.5, and in Cygwin on Windows! And as our CI proves, it works in MinGW! :)

image

image