Make randtilegen and rgbgfx_test compile with MSVC

This commit is contained in:
ISSOtm
2022-04-30 20:37:46 +02:00
committed by Eldred Habert
parent 01cf0c5f98
commit 3cfe7800c7
6 changed files with 330 additions and 205 deletions

View File

@@ -46,12 +46,14 @@
# include <unistd.h>
#endif
/* MSVC doesn't support `[static N]` for array arguments from C99 */
/* MSVC doesn't support `[static N]` for array arguments from C99 or C11 */
#ifdef _MSC_VER
# define MIN_NB_ELMS(N)
# define ARR_QUALS(...)
# define NONNULL(ptr) *ptr
#else
# define MIN_NB_ELMS(N) static (N)
# define ARR_QUALS(...) __VA_ARGS__
# define NONNULL(ptr) ptr[static 1]
#endif