April 9, 201511 yr Commercial Member Now, I have to confess that I've only recently come out of the dark ages of the FS700 and FS800 macros and started using the FS900 macro. I've yet to run headlong into the serialization of the FS1000 macro (later, later ). I'm getting a redefinition warning when compiling two gauges: Macro definitions:- FAILURE_RECORD cpc_fail[] ={ {FAIL_NONE, FAIL_ACTION_NONE}};#define GAUGE_NAME "cpc\0"#define GAUGEHDR_VAR_NAME gaugehdr_cpc#define GAUGE_W 20#include "flighteng\dfd_cpc.cpp"FAILURE_RECORD ecs_fail[] ={ {FAIL_NONE, FAIL_ACTION_NONE}};#define GAUGE_NAME "ecs\0"#define GAUGEHDR_VAR_NAME gaugehdr_ecs#define GAUGE_W 20 #include "flighteng\dfd_ecs.cpp" Warnings:- 1>xxxxxxxxxxxxxx.cpp(1265): warning C4005: 'GAUGE_NAME' : macro redefinition1> xxxxxxxxxxxxxx.cpp(1254) : see previous definition of 'GAUGE_NAME'1>xxxxxxxxxxxxxx.cpp(1266): warning C4005: 'GAUGEHDR_VAR_NAME' : macro redefinition1> xxxxxxxxxxxxxx.cpp(1255) : see previous definition of 'GAUGEHDR_VAR_NAME' I agree that the warning is pretty explicit and I suspect that it is something to do with the FS900 header structure: GAUGE_HEADER_FS900(gaugehdr_cpc,GAUGE_W, cpc_gauge_name, &cpc_list, cpc_mouse_rect, cpc_update, 0,0); Would someone be kind enough to tell me what I need to change to suppress the warnings? I gave up after thirty or so minutes!
April 9, 201511 yr You need to #undef the macros after each sub-gauge: #define GAUGE_NAME "cpc\0"#define GAUGEHDR_VAR_NAME gaugehdr_cpc#define GAUGE_W 20#include "flighteng\dfd_cpc.cpp" #undef GAUGE_NAME #undef GAUGEHDR_VAR_NAME #undef GAUGE_W //for completeness only, seeing as you're using the same value again
April 9, 201511 yr Author Commercial Member Thanks Doug. The #undef statement in the gauge.c/.cpp file worked fine for FS700 and FS800, so it never occurred to me that it might night work for the later versions. Of course, now I have your answer it's d*mned obvious!!! :lol:
Create an account or sign in to comment