Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comments

Invert NOB_STRIP_PREFIX and NOB_STRIP_PREFIX_GUARD_ checks#125

Open
minefreak19 wants to merge 1 commit intotsoding:main from
minefreak19:nob-prefix-guard
Open

Invert NOB_STRIP_PREFIX and NOB_STRIP_PREFIX_GUARD_ checks #125
minefreak19 wants to merge 1 commit intotsoding:main from
minefreak19:nob-prefix-guard

Conversation

@minefreak19
Copy link
Contributor

@minefreak19 minefreak19 commented Aug 30, 2025

This way, NOB_STRIP_PREFIX_GUARD_ is not defined until the prefixes are actually stripped, so a header file can simply #include "nob.h" without polluting the namespace while the corresponding C file can #define NOB_STRIP_PREFIX and re-include nob.h to use the short names.

#include "header_that_includes_nob.h"
// now this define doesn't need to be at the top of the file
#define NOB_STRIP_PREFIX
#include "nob.h"
// ...

k00lagin reacted with thumbs up emoji
This way, NOB_STRIP_PREFIX_GUARD_ is not defined until the prefixes are
actually stripped, so a header file can simply `#include "nob.h"`
without polluting the namespace while the corresponding C file can
`#define NOB_STRIP_PREFIX` and re-include nob.h to use the short names.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /