Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions nob.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* nob - v3.10.0 - Public Domain - https://github.com/tsoding/nob.h
/* nob - v3.10.1 - Public Domain - https://github.com/tsoding/nob.h
This library is the next generation of the [NoBuild](https://github.com/tsoding/nobuild) idea.
Expand Down Expand Up @@ -116,6 +116,10 @@
#define NOBDEF
#endif /* NOBDEF */

#if defined(__unix__) && !defined(_POSIX_C_SOURCE)
#define _POSIX_C_SOURCE 200809L
#endif

#ifndef NOB_ASSERT
#include <assert.h>
#define NOB_ASSERT assert
Expand Down Expand Up @@ -798,10 +802,10 @@ NOBDEF char *nob_temp_running_executable_path(void);

#ifndef nob_cc
# if _WIN32
# if defined(__GNUC__)
# define nob_cc(cmd) nob_cmd_append(cmd, "cc")
# elif defined(__clang__)
# if defined(__clang__)
# define nob_cc(cmd) nob_cmd_append(cmd, "clang")
# elif defined(__GNUC__)
# define nob_cc(cmd) nob_cmd_append(cmd, "cc")
# elif defined(_MSC_VER)
# define nob_cc(cmd) nob_cmd_append(cmd, "cl.exe")
# elif defined(__TINYC__)
Expand Down Expand Up @@ -3130,6 +3134,8 @@ NOBDEF char *nob_temp_running_executable_path(void)
/*
Revision history:
3.10.1 (2026-10-28) Set _POSIX_C_SOURCE to 200809L for Unix environments (by @aalmkainzi)
Make nob_cc check for clang first on _WIN32 (by @aalmkainzi)
3.10.0 (2026-07-17) Make NOB_SVLIT a bit more usable at compile-time (by @Arhcout)
Add NOB_SVLIT_STATIC for when a compiler simply refuses to accept NOB_SVLIT() at compile-time (looking at you `cl.exe /TC`) (by @rexim)
3.9.0 (2026-07-15) Add NOB_TODOF() and NOB_UNREACHABLEF()
Expand Down
9 changes: 1 addition & 8 deletions shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,8 @@
#else // __cplusplus
#if defined(_MSC_VER)
#define nob_cc_flags(cmd) cmd_append(cmd, "/TC", "/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.")
#elif defined(__FreeBSD__)
// "-D_POSIX_C_SOURCE=200112L" hides required symbols on FreeBSD
#define nob_cc_flags(cmd) cmd_append(cmd, "-Wall", "-Wextra", "-Wswitch-enum", "-std=c99", "-ggdb", "-I.");
#else
#define nob_cc_flags(cmd) cmd_append(cmd, "-Wall", "-Wextra", "-Wswitch-enum", "-std=c99", "-D_POSIX_C_SOURCE=200112L", "-ggdb", "-I.");
#define nob_cc_flags(cmd) cmd_append(cmd, "-Wall", "-Wextra", "-Wswitch-enum", "-std=c99", "-ggdb", "-I.");
#endif
#endif // __cplusplus

Expand Down
1 change: 0 additions & 1 deletion tests/bytes_for_utf8.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <stdio.h>
#define NOB_IMPLEMENTATION
#include "nob.h"

Expand Down
2 changes: 0 additions & 2 deletions tests/sv_foreach.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include <stdio.h>

#define NOB_IMPLEMENTATION
#include "nob.h"

Expand Down
Loading