nob.h icon indicating copy to clipboard operation
nob.h copied to clipboard

Add automatic prefix handling + test file

Open GioseaxMC opened this issue 6 months ago • 2 comments

Added nob(), Nob() and NOB() macros for automatic prefixing, to avoid manually adding stuff to the list of macros at the end of file.

The system is completely independent from the existing stripping system as it can be considered just an extension.

void nob(print) (char* mes) {
    printf("> %s\n", mes);
}

void main() {
    nob(print)("This always compiles");
    nob_print("This compiles only without NOB_STRIP_PREFIX defined");
}

the code above will declare the nob_print function or the print function.

GioseaxMC avatar Aug 15 '25 19:08 GioseaxMC

You need to add the test name into nob.c list of tests, for run it.

yuI4140 avatar Aug 15 '25 20:08 yuI4140

You need to add the test name into nob.c list of tests, for run it.

will do thank you!

GioseaxMC avatar Aug 15 '25 21:08 GioseaxMC