https://github.com/shader-slang/slang
Raw File
Tip revision: 163bf58765cc2c921d20fa3a22d268d5e3785a4d authored by Tim Foley on 19 April 2018, 16:45:40 UTC
Add type legalization support for "field extract" op (#501)
Tip revision: 163bf58
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