summaryrefslogtreecommitdiff
path: root/source/slang/object-meta-begin.h
blob: 7340ed413c2a8d3bd7180ed6a7ad4b3c429fceba (plain)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// object-meta-begin.h

#ifndef SYNTAX_CLASS
#error The 'SYNTAX_CLASS' macro should be defined before including 'object-meta-begin.h'
#endif

#ifndef ABSTRACT_SYNTAX_CLASS
#define ABSTRACT_SYNTAX_CLASS(NAME, BASE) SYNTAX_CLASS(NAME, BASE)
#endif

#ifndef END_SYNTAX_CLASS
#define END_SYNTAX_CLASS() /* empty */
#endif

#ifndef DECL_FIELD
#define DECL_FIELD(TYPE, NAME) SYNTAX_FIELD(TYPE, NAME)
#endif

#ifndef SYNTAX_FIELD
#define SYNTAX_FIELD(TYPE, NAME) FIELD(TYPE, NAME)
#endif

#ifndef FIELD_INIT
#define FIELD_INIT(TYPE, NAME, INIT) FIELD(TYPE, NAME)
#endif

#ifndef FIELD
#define FIELD(...) /* empty */
#endif

#ifndef RAW
#define RAW(...) /* empty */
#endif

#define SIMPLE_SYNTAX_CLASS(NAME, BASE) SYNTAX_CLASS(NAME, BASE) END_SYNTAX_CLASS()

// Hack to remove 'warning C4702: unreachable code' on VS2017, blocking compilation
// Note! This is matched in object-meta-end.h 
#if _MSC_VER >= 1910
#pragma warning(push)
#pragma warning(disable: 4702)
#endif