https://github.com/shader-slang/slang
Raw File
Tip revision: b3fbb92b3f8147cb37eb8b49e1c125890a6a0be6 authored by Yong He on 08 June 2020, 16:28:03 UTC
Merge pull request #1378 from csyonghe/fix
Tip revision: b3fbb92
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