https://github.com/shader-slang/slang
Raw File
Tip revision: c6756d76fd70424f5b3bd1d910a5afc46dc7c83e authored by Yong He on 29 February 2024, 07:26:51 UTC
Allow non-static const to be considered compile-time constant. (#3645)
Tip revision: c6756d7
undef.slang
//TEST:SIMPLE:
// #undef support

// warning: undef of something not defined
#undef FOO

#define BAR 1.0f

float foo() { return BAR + 2.0; }

#ifdef BAR
// okay
#else
#error not okay
#endif

#undef BAR

typedef float BAR;

BAR bar() { return 2.0; }

#if !defined(BAR)
// okay
#else
#error not okay
#endif


#define FOO

#undef FOO
back to top