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:
Username404 2021-07-31 18:56:17 +02:00
parent ac195d413b
commit 4512909b23
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
4 changed files with 16 additions and 13 deletions

View File

@ -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()) {

View File

@ -1,5 +1,5 @@
#ifndef JS_HPP
#define JS_HPP
#define JS_HPP JsTarget
struct JsTarget: Target {};

View File

@ -1,5 +1,5 @@
#ifndef LUA_HPP
#define LUA_HPP
#define LUA_HPP LuaTarget
struct LuaTarget: Target {};

View File

@ -1,5 +1,5 @@
#ifndef PY_HPP
#define PY_HPP
#define PY_HPP PyTarget
struct PyTarget: Target {};