ID:2105464
 
Applies to:Dream Maker
Status: Open

Issue hasn't been assigned a status value.
#if can currently only compare numbers;

#define NUMBER 100
#define STRING "foo"
#define PATH /atom/movable

#if NUMBER == 100 // this is OK
// ...
#endif

#if STRING == "foo" // unexpected token: "foo"
// ...
#endif

#if PATH == /atom/movable // unexpected token: /
// ...
#endif


It'd be great if #if was able to compare paths and/or (constant) strings too; I'm trying to make our map-swapping system on Bay insert a define that's later checked to see if more information about a specific map needs compiling (ie if it's the currently selected map), but short of assigning each map a number I can't find an easy way to do it while only requiring one file #include to change map.
This wouldn't even work in C, though? Strings are not constants.
Not in C, no, but they are in DM. I don't see a reason to limit what the DM preprocessor can do simply based on the fact the C preprocessor doesn't do this. If it's infeasible or doesn't make sense for the DM preprocessor to do this, sure, but I don't think "this wouldn't work in C" is a reason to not add it.
It looks like the current code for this is strongly built around using numbers, so this would be a difficult thing to change quickly. I won't say it's not feasible, but it's not gonna make the cut for 511 at least.
Bump. I could use this.