================ @@ -1344,6 +1344,15 @@ static void InitializePredefinedMacros(const TargetInfo &TI, if (TI.getTriple().isOSBinFormatELF()) Builder.defineMacro("__ELF__"); + // Target OS macro definitions. + if (PPOpts.DefineTargetOSMacros) { + const llvm::Triple &Triple = TI.getTriple(); +#define TARGET_OS(Name, Predicate) \ + Builder.defineMacro(#Name, Predicate ? "1" : "0"); ---------------- jroelofs wrote:
`Predicate` should be in parens to make the precedence explicit in the face of preprocessor expansion. https://github.com/llvm/llvm-project/pull/74676 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits