From 2a5df0bb323686503d2cca8d61ba32bc52d6dabc Mon Sep 17 00:00:00 2001 From: Username404 Date: Sat, 7 Aug 2021 11:41:04 +0200 Subject: [PATCH] Put the #ifdef directives before the case statements in Target.hpp to avoid issues. --- src/headers/transpiler/Target.hpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/headers/transpiler/Target.hpp b/src/headers/transpiler/Target.hpp index c3c6395..0347843 100644 --- a/src/headers/transpiler/Target.hpp +++ b/src/headers/transpiler/Target.hpp @@ -38,18 +38,15 @@ shared_ptr Target::forName(string_view name) { shared_ptr target; #define ADDTARGET(X) target = make_shared(X()); switch (selected) { - 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 + #ifdef LUA_HPP + case LUA: ADDTARGET(LUA_HPP); break; + #endif + #ifdef JS_HPP + case JS: ADDTARGET(JS_HPP); break; + #endif + #ifdef PY_HPP + case PY: ADDTARGET(PY_HPP); break; + #endif case NONE: default: { if (not name.empty()) {