From 1c0940e4d48b4a447525ab3521e9abba68a808ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20Myllyl=C3=A4?= Date: Thu, 14 Aug 2025 22:26:51 +0300 Subject: [PATCH] Add posix for mac There seemed to be two options: use -D_DARWIN_C_SOURCE or newer posix source like -D_POSIX_C_SOURCE=200809L in this commit --- shared.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/shared.h b/shared.h index c5a235d..5bcb125 100644 --- a/shared.h +++ b/shared.h @@ -11,9 +11,7 @@ #if defined(_MSC_VER) # define nob_cc_flags(cmd) cmd_append(cmd, "/W4", "/nologo", "/D_CRT_SECURE_NO_WARNINGS", "-I.") #elif defined(__APPLE__) || defined(__MACH__) -// TODO: "-std=c99", "-D_POSIX_C_SOURCE=200112L" didn't work for MacOS, don't know why, don't really care that much at the moment. -// Anybody who does feel free to investigate. -# define nob_cc_flags(cmd) cmd_append(cmd, "-Wall", "-Wextra", "-Wswitch-enum", "-I.") +# define nob_cc_flags(cmd) cmd_append(cmd, "-Wall", "-Wextra", "-Wswitch-enum", "-std=c99", "-D_POSIX_C_SOURCE=200809L", "-I.") #else # define nob_cc_flags(cmd) cmd_append(cmd, "-Wall", "-Wextra", "-Wswitch-enum", "-std=c99", "-D_POSIX_C_SOURCE=200112L", "-ggdb", "-I."); #endif