[cfe-commits] [Patch][Review] __has_feature(__feature__)

Jean-Daniel Dupas devlists at shadowlab.org
Fri Feb 24 15:34:28 PST 2012


Le 24 févr. 2012 à 20:47, Jonathan Sauer a écrit :

> Hello,
> 
> following the discussion in cfe-dev[*], I decided to put my money where my mouth is and have attached a patch
> that makes it possible to use __has_feature(__feature__) in place of __has_feature(feature) to protect the
> feature name in case the user defines a macro with the same name.
> 
> I modeled the patch after the similar handling of __attribute__ names.
> 

+  if (Feature.startswith("__") && Feature.endswith("__"))
+    Feature = Feature.substr(2, Feature.size() - 4);

What append if Feature equals '__' or '___' ? 








More information about the cfe-commits mailing list