Skip to main content

Timeline for single-line #ifdef in C/C++

Current License: CC BY-SA 4.0

3 events
when toggle format what by license comment
Jun 13, 2021 at 12:54 comment added Alex @RegusPregus yes, as mentioned in other answer you should use constexpr or if for single-line definition.
Jun 13, 2021 at 12:41 comment added Regus Pregus This solution does not work with arbitrary identifiers and require pre-defining similar sections for each identifier (which are not necessarily known to me upfront). "x" in MY_IFDEF was exactly an argument for such identifier.
Jun 12, 2021 at 18:31 history answered Alex CC BY-SA 4.0