Nuklear
Nuklear copied to clipboard
Safer NK_LEN macro
Protects from division by 0 and when used from <= C11
https://stackoverflow.com/a/1598827
C++ sizeof will never return 0.
From C++ standard, 9/3 "Classes": "Complete objects and member subobjects of class type shall have nonzero size."
IMHO if the new macro helps in some real cases or for some compilers, then we can merge this. Any such examples @ryuukk ?
C++ sizeof will never return 0.
Neither will C. The lowest addressable unit is defined to be char which will always be 1 byte. And you cannot apply sizeof to a bit-field.
Sorry i didn't meant "and when used from C++"
I meant when used with a <= C11 compiler, it'll refuse to compile
Looks ok to me too
Just missing nuklear.h build and version bump