Put the #ifdef directives before the case statements in Target.hpp to avoid issues.

This commit is contained in:
Username404 2021-08-07 11:41:04 +02:00
parent 2f853fe797
commit 2a5df0bb32
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 9 additions and 12 deletions

View File

@ -38,18 +38,15 @@ shared_ptr<Target> Target::forName(string_view name) {
shared_ptr<Target> target; shared_ptr<Target> target;
#define ADDTARGET(X) target = make_shared<X>(X()); #define ADDTARGET(X) target = make_shared<X>(X());
switch (selected) { switch (selected) {
case LUA: #ifdef LUA_HPP
#ifdef LUA_HPP case LUA: ADDTARGET(LUA_HPP); break;
ADDTARGET(LUA_HPP); break; #endif
#endif #ifdef JS_HPP
case JS: case JS: ADDTARGET(JS_HPP); break;
#ifdef JS_HPP #endif
ADDTARGET(JS_HPP); break; #ifdef PY_HPP
#endif case PY: ADDTARGET(PY_HPP); break;
case PY: #endif
#ifdef PY_HPP
ADDTARGET(PY_HPP); break;
#endif
case NONE: case NONE:
default: { default: {
if (not name.empty()) { if (not name.empty()) {