GLSL: Fix #396: Error when 'defined' comes from macro expansion.

This commit is contained in:
John Kessenich
2017-06-07 17:15:38 -06:00
parent 65755667d5
commit 2eb135506a
4 changed files with 24 additions and 1 deletions

View File

@@ -90,8 +90,10 @@ ERROR: 12:9504: '#if' : unexpected tokens following directive
ERROR: 12:9506: '#error' : \ 377
ERROR: 12:9507: '#error' : \ 376
ERROR: 12:9508: '#error' : \ 377
ERROR: 12:9602: 'defined' : cannot use in preprocessor expression when expanded from macros
ERROR: 12:9603: '#error' : DEF_DEFINED then
ERROR: 12:10002: '' : missing #endif
ERROR: 88 compilation errors. No code generated.
ERROR: 90 compilation errors. No code generated.
Shader version: 400

View File

@@ -337,6 +337,16 @@ int aoeua = FOOOM;
#error \ 376
#error \377
// ERROR for macro expansion to yield 'defined'
#line 9600
#define DEF_MAC
#define DEF_DEFINED defined
#if DEF_DEFINED DEF_MAC
#error DEF_DEFINED then
#else
#error DEF_DEFINED else
#endif
#line 10000
#if 1
#else