Trying to use the __has_include preprocessor command immediately after an #if, #else, #endif block in the same file results in a "Preprocessor Error - Invalid File Name(empty filename)" erorr.
This doesn't seem to occur when the #if block immediately above the __has_include command does not have an #else entry. It doesn't seem to matter if any #if blocks earlier in the file have an #else entry, as long as the block immediately before the __has_include does not.
Here are some examples from a description.ext file (in this case, searching for a file from the ACE3 mod):
This code block seems to work without issue.
#define TESTDEFINE 1 #ifdef TESTDEFINE first_mission_value = 1; #else first_mission_value = 0; #endif #ifdef TESTDEFINE second_mission_value = 1; #endif #if __has_include("\z\ace\addons\main\script_component.hpp") ace3_value = 1; #endif
This code block results in a "Preprocessor Error - Invalid File Name(empty filename)" error
#define TESTDEFINE 1 #ifdef TESTDEFINE second_mission_value = 1; #endif #ifdef TESTDEFINE first_mission_value = 1; #else first_mission_value = 0; #endif #if __has_include("\z\ace\addons\main\script_component.hpp") ace3_value = 1; #endif