File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,28 @@ EnumToString(int iVal,
106
106
} \
107
107
}
108
108
109
+ /* Disable errors about instantiations of static member variables of the
110
+ * templated class not being defined. These are all defined in different
111
+ * translation units by LuaXType, a macro that does a whole lot of stuff
112
+ * including initializing them.
113
+ *
114
+ * Because it happens in a different translation unit, there's not really a
115
+ * great way to do this better. You could state that external instantiations
116
+ * happen elsewhere with a `extern template struct EnumTraits<T>;` for every T,
117
+ * but the issue is that this header file doesn't know about the existence of
118
+ * those classes.
119
+ */
120
+
121
+ #if defined(__clang__)
122
+ #pragma clang diagnostic push
123
+ #pragma clang diagnostic ignored "-Wundefined-var-template"
124
+ #elif defined(__GNUC__)
125
+ #pragma GCC diagnostic push
126
+ #pragma GCC diagnostic ignored "-Wundefined-var-template"
127
+ #elif defined(_MSC_VER)
128
+ // TODO: Does anything need to be here?
129
+ #endif
130
+
109
131
namespace Enum {
110
132
template <typename T>
111
133
static auto
@@ -122,6 +144,14 @@ Check(lua_State* L,
122
144
bAllowInvalid,
123
145
bAllowAnything));
124
146
}
147
+ #if defined(__clang__)
148
+ #pragma clang pop
149
+ #elif defined(__GNUC__)
150
+ #pragma GCC pop
151
+ #elif defined(_MSC_VER)
152
+
153
+ #endif
154
+
125
155
template <typename T>
126
156
static void
127
157
Push (lua_State* L, T iVal)
You can’t perform that action at this time.
0 commit comments