https://github.com/shader-slang/slang
Raw File
Tip revision: c4541e83b4a57d8317932bc4277ee6a2d45bb2f6 authored by Robert Stepinski on 16 August 2019, 15:30:48 UTC
Fix a typo in core.meta.slang which was causing an assert when (#1024)
Tip revision: c4541e8
define-function-like.slang
//TEST(smoke):SIMPLE:
// support for function-like macros

#define FOO(x) 1.0 + x

float foo(float y) { return FOO(y) * 2.0; }

// simple token pasting

#define PASTE(a,b) a##b

PASTE(flo,at) bar() { return 0.0; }

// no space before parens? not a function-like macro

#define M (x) - (x)

// Error: undefined identifier `x`
float bar(float a) { return M(a); }
back to top