dy/prepr

Doesn't support `#define THING`

AndrewRayCode opened this issue · 3 comments

I believe this is valid in glsl:

#define THING
#ifdef THING
...
#end

But this raises

Error: Macro definition "#define THING" is malformed

dy commented

Is the #define THING correct?
I followed https://gcc.gnu.org/onlinedocs/cpp/Macros.html and did not find anything like that.
What is the expected result? THING === true?

It's valid. It doesn't expand, it's just used for future #ifdef etc checks. For example search http://tigcc.ticalc.org/doc/cpp.html for FILE_FOO_SEEN

edit: https://gcc.gnu.org/onlinedocs/cpp/Once-Only-Headers.html#Once-Only-Headers

dy commented

Should be fixed in 4c88adb