https://github.com/shader-slang/slang
Raw File
Tip revision: 87c50cf1644454cdc9e7f6d1262bee29bfc86e80 authored by Tim Foley on 29 March 2018, 22:47:58 UTC
Avoid crash when bad argument given to [instance(...)] attribute (#464)
Tip revision: 87c50cf
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