3 ms·
You may be interested in unifdef, which selectively evaluates and removes ifdefs. https://dotat.at/prog/unifdef/ https://dotat.at/prog/unifdef/ I used it once
by senkora 3y ago
You may be interested in unifdef, which selectively evaluates and removes ifdefs.
https://dotat.at/prog/unifdef/ https://dotat.at/prog/unifdef/
I used it once at work for a niche usecase. It’s main use case seems to be making it easier to simplify platform-specific code when you remove support from old platforms in legacy codebases.
- peter_d_sherman 3y agoIt seems that the use of macros/IFDEF (in any language, not just C) -- bifurcates into two distinct use-cases: 1) Platform/Processor/OS configuration/build use-cases. (and) 2) All other use-cases that are not directly related to #1. In other words, if you're a future language designer and you design a macro system for your language, you might wish to distinguish between configuration/platform/build related macros -- and other macros not directly related to build and configuration... Doing that would allow one set and/or the other set to be selectively and easily evaluated back into the non-macro source of the base language -- depending on what is desired by the language user... Anyway, an excellent link!