https://github.com/shader-slang/slang
Raw File
Tip revision: 2d4cd997bcc95cb13552b540c376a8200f3766d5 authored by Yong He on 21 July 2023, 22:35:54 UTC
Don't error on disabled warnings when treatWarnAsErr. (#3013)
Tip revision: 2d4cd99
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