From 2242f7c622ad168113ff27b98f583eab4af636b8 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Mon, 13 Jun 2016 09:20:09 -0700 Subject: [PATCH 1/4] Fix for MikeRo Tools strict requirement for #undef usage --- addons/main/script_macros.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index 503cee0619..2f6f99c444 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -9,6 +9,8 @@ #define DFUNC(var1) TRIPLES(ADDON,fnc,var1) #define DEFUNC(var1,var2) TRIPLES(DOUBLES(PREFIX,var1),fnc,var2) +#undef QFUNC +#undef QEFUNC #define QFUNC(var1) QUOTE(DFUNC(var1)) #define QEFUNC(var1,var2) QUOTE(DEFUNC(var1,var2)) @@ -16,12 +18,14 @@ #define SETVAR_SYS(var1,var2) setVariable [ARR_2(QUOTE(var1),var2)] #define SETPVAR_SYS(var1,var2) setVariable [ARR_3(QUOTE(var1),var2,true)] +#undef GETVAR #define GETVAR(var1,var2,var3) var1 GETVAR_SYS(var2,var3) #define GETMVAR(var1,var2) missionNamespace GETVAR_SYS(var1,var2) #define GETUVAR(var1,var2) uiNamespace GETVAR_SYS(var1,var2) #define GETPRVAR(var1,var2) profileNamespace GETVAR_SYS(var1,var2) #define GETPAVAR(var1,var2) parsingNamespace GETVAR_SYS(var1,var2) +#undef SETVAR #define SETVAR(var1,var2,var3) var1 SETVAR_SYS(var2,var3) #define SETPVAR(var1,var2,var3) var1 SETPVAR_SYS(var2,var3) #define SETMVAR(var1,var2) missionNamespace SETVAR_SYS(var1,var2) @@ -82,6 +86,7 @@ #ifdef DISABLE_COMPILE_CACHE #define PREP(fncName) DFUNC(fncName) = compile preprocessFileLineNumbers QPATHTOF(functions\DOUBLES(fnc,fncName).sqf) #else + #undef PREP #define PREP(fncName) [QPATHTOF(functions\DOUBLES(fnc,fncName).sqf), QFUNC(fncName)] call CBA_fnc_compileFunction #endif From b79a00d8d17fb8638467761a52722e3bda25a1f6 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Tue, 14 Jun 2016 08:11:28 -0700 Subject: [PATCH 2/4] These 2 can be removed, since they are in CBA since 2.4.0 as Note from jonpas --- addons/main/script_macros.hpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index 2f6f99c444..71fa3bf8e9 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -9,11 +9,6 @@ #define DFUNC(var1) TRIPLES(ADDON,fnc,var1) #define DEFUNC(var1,var2) TRIPLES(DOUBLES(PREFIX,var1),fnc,var2) -#undef QFUNC -#undef QEFUNC -#define QFUNC(var1) QUOTE(DFUNC(var1)) -#define QEFUNC(var1,var2) QUOTE(DEFUNC(var1,var2)) - #define GETVAR_SYS(var1,var2) getVariable [ARR_2(QUOTE(var1),var2)] #define SETVAR_SYS(var1,var2) setVariable [ARR_2(QUOTE(var1),var2)] #define SETPVAR_SYS(var1,var2) setVariable [ARR_3(QUOTE(var1),var2,true)] From d5750a6c402fbaa3f1c36442ce5d9e06ffb3403a Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Tue, 14 Jun 2016 08:12:29 -0700 Subject: [PATCH 3/4] Remove Tab --- addons/main/script_macros.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index 71fa3bf8e9..a733b2b055 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -81,7 +81,7 @@ #ifdef DISABLE_COMPILE_CACHE #define PREP(fncName) DFUNC(fncName) = compile preprocessFileLineNumbers QPATHTOF(functions\DOUBLES(fnc,fncName).sqf) #else - #undef PREP + #undef PREP #define PREP(fncName) [QPATHTOF(functions\DOUBLES(fnc,fncName).sqf), QFUNC(fncName)] call CBA_fnc_compileFunction #endif From 4c2c647842bea55122bfba6e01e38fa885d2b39b Mon Sep 17 00:00:00 2001 From: Glowbal Date: Fri, 17 Jun 2016 21:44:04 +0200 Subject: [PATCH 4/4] Fix change in behaviour of QFUNC When using QFUNC, the intend most often is to have the name of the variable referencing the function as a string. This behaviour works when compiling without debug enabled. However if debug is enabled, QFUNC compiles in with the debug wrapper, becoming a code string instead of a string representation of a variable reference. A good example where this change of behaviour can be a problem is config attributes that refer to a call back (used a lot within ACE). In normal build, you will use a getvar to get the relevant code, as it is expected to point to the function. When using debug, you will need to do a compile instead, as it's a string representing a code block. --- addons/main/script_macros.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index a1a234abc5..c7997dee28 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -9,6 +9,11 @@ #define DFUNC(var1) TRIPLES(ADDON,fnc,var1) #define DEFUNC(var1,var2) TRIPLES(DOUBLES(PREFIX,var1),fnc,var2) +#undef QFUNC +#undef QEFUNC +#define QFUNC(var1) QUOTE(DFUNC(var1)) +#define QEFUNC(var1,var2) QUOTE(DEFUNC(var1,var2)) + #define GETVAR_SYS(var1,var2) getVariable [ARR_2(QUOTE(var1),var2)] #define SETVAR_SYS(var1,var2) setVariable [ARR_2(QUOTE(var1),var2)] #define SETPVAR_SYS(var1,var2) setVariable [ARR_3(QUOTE(var1),var2,true)]