Don't break in the ADDTARGET macro of Target.hpp, and define class names of Py.hpp, Lua.hpp and Js.hpp to use them in Target.hpp.
This commit is contained in:
parent
ac195d413b
commit
4512909b23
|
@ -36,17 +36,20 @@ shared_ptr<Target> Target::forName(string_view name) {
|
|||
}
|
||||
}
|
||||
shared_ptr<Target> target;
|
||||
#define ADDTARGET(X) target = make_shared<X>(X()); break;
|
||||
#define ADDTARGET(X) target = make_shared<X>(X());
|
||||
switch (selected) {
|
||||
#ifdef LUA_HPP
|
||||
case LUA: ADDTARGET(LuaTarget)
|
||||
#endif
|
||||
#ifdef JS_HPP
|
||||
case JS: ADDTARGET(JsTarget)
|
||||
#endif
|
||||
#ifdef PY_HPP
|
||||
case PY: ADDTARGET(PyTarget)
|
||||
#endif
|
||||
case LUA:
|
||||
#ifdef LUA_HPP
|
||||
ADDTARGET(LUA_HPP); break;
|
||||
#endif
|
||||
case JS:
|
||||
#ifdef JS_HPP
|
||||
ADDTARGET(JS_HPP); break;
|
||||
#endif
|
||||
case PY:
|
||||
#ifdef PY_HPP
|
||||
ADDTARGET(PY_HPP); break;
|
||||
#endif
|
||||
case NONE:
|
||||
default: {
|
||||
if (not name.empty()) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef JS_HPP
|
||||
#define JS_HPP
|
||||
#define JS_HPP JsTarget
|
||||
|
||||
struct JsTarget: Target {};
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef LUA_HPP
|
||||
#define LUA_HPP
|
||||
#define LUA_HPP LuaTarget
|
||||
|
||||
struct LuaTarget: Target {};
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef PY_HPP
|
||||
#define PY_HPP
|
||||
#define PY_HPP PyTarget
|
||||
|
||||
struct PyTarget: Target {};
|
||||
|
||||
|
|
Loading…
Reference in New Issue