gcc/make problem with define
Posted: 01 Apr 2017 14:32
Hi all,
For a recode of the 2cc TrainsInNML I'm working on, I want to ease the reuse of some code that is coming back regularly. One of the things I'm working on, are capacity switches for several passenger vehicles. I'm using the following definition:
The VEHICLE_NAME and TYPE input are not used, I'm aware of that, but that is not the problem. Both VEHICLEIDENTIFIER and HEAD_CAPACITY are defined before this ENGINECAPACITYSWITCH is included for a vehicle, but the problem that I'm having is that VEHICLEIDENTIFIER is not replaced, with the defined value, while HEAD_CAPACITY is.
As I also have other switches for which I want to do something like this, I would really like to have this working.
For a recode of the 2cc TrainsInNML I'm working on, I want to ease the reuse of some code that is coming back regularly. One of the things I'm working on, are capacity switches for several passenger vehicles. I'm using the following definition:
Code: Select all
#define ENGINECAPACITYSWITCH(VEHICLE_NAME, TYPE) \
switch(FEAT_TRAINS, SELF, switch_VEHICLEIDENTIFIER_capacity_engine, cargo_classes) { \
bitmask(CC_MAIL): HEAD_CAPACITY/2; \
bitmask(CC_ARMOURED): HEAD_CAPACITY/4; \
HEAD_CAPACITY; \
}
As I also have other switches for which I want to do something like this, I would really like to have this working.