File: preprocess.inactive_stringify.vert

package info (click to toggle)
glslang 16.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 51,084 kB
  • sloc: cpp: 90,714; yacc: 4,243; sh: 603; python: 305; ansic: 94; javascript: 74; makefile: 17
file content (28 lines) | stat: -rwxr-xr-x 486 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#version 460

// This tests that the preprocessor error
// "error: '#' : (#) can be preceded in its line only by spaces or horizontal tab"
// isn't enforced when inactive (e.g. inside #if 0)

#if 0
#define STRINGIFY(X) #X
#endif

#define C 0

#if 1
#ifdef A
#elif defined B
#elif C
// OK, since preprocessor evaluates to inactive
#define STRINGIFY(X) #X
#endif
#endif

// OK in comments
// #define STRINGIFY(X) #X

void main()
{
    gl_Position = vec4(1.0);
}