Page MenuHomeFeedback Tracker

Add #if and __has_include preprocessor commands
Assigned, NormalPublic

Description

https://docs.microsoft.com/en-us/cpp/preprocessor/hash-if-hash-elif-hash-else-and-hash-endif-directives-c-cpp?view=vs-2019

Mods being able to use __has_include could potentially remove the need for compat addons.

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Config
Additional Information

An alternative to this would be T120495

Event Timeline

Freddo3000 edited Additional Information. (Show Details)Sep 3 2020, 2:59 PM
DrSova added a subscriber: DrSova.Sep 4 2020, 2:59 PM
h- added a subscriber: h-.Sep 5 2020, 12:58 PM
dedmen added a subscriber: dedmen.Dec 16 2020, 9:15 PM

unrelated to this, #if actually landed.
__has_include is a great idea! thanks.

dedmen claimed this task.Dec 16 2020, 9:16 PM
dedmen changed the task status from New to Assigned.
dedmen set Ref Ticket to AIII-53670.

Come to think of it, maybe a __FILEPATCHING__ macro would be useful as well, set to 1 if filepatching is enabled and 0 if disabled. Or simply not defined if disabled, either should work I'd imagine.

To add to this, having a __IS_CONFIG__ macro would be useful. It would be 0 in preprocessFile, 1 if config.cpp, 2 if description.ext