<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Great idea, Chris!<div><br><br>> From: clattner@apple.com<br>> To: eli.friedman@gmail.com<br>> Date: Fri, 12 Jun 2009 22:44:18 -0700<br>> CC: cfe-dev@cs.uiuc.edu<br>> Subject: Re: [cfe-dev] magic __has_feature macro<br>> <br>> <br>> On Jun 12, 2009, at 6:18 PM, Eli Friedman wrote:<br>> <br>> > On Fri, Jun 12, 2009 at 6:03 PM, Chris Lattner<clattner@apple.com>  <br>> > wrote:<br>> >> Hi All,<br>> >><br>> >> As Clang "grows up", it will continue to get more features.  I'd like<br>> >> to add new "__has_feature" builtin function-like macro that evaluates<br>> >> to 0 or 1 if clang has a specified feature.<br>> ><br>> > What does it evaluate to if clang doesn't have the specified  <br>> > feature? :)<br>> <br>> haha. :)<br>> <br>> > Sounds like a good idea.<br>> <br>> Ok, my proposed use of if defined won't work because of the parsing  <br>> structure of pp conditionals.  However, something like this will work:<br>> <br>> #ifndef __has_feature<br>> #define __has_feature(x) 0<br>> #endif<br>> <br>> // ...<br>> <br>> #if __has_feature(x)<br>>   ... whatever ...<br>> #endif<br>> <br>> <br>> I also plan to add a __has_builtin(x) as well, so that we can write  <br>> things like:<br>> <br>> #if __has_builtin(__builtin_trap)<br>>    __builtin_trap();<br>> #else<br>>    abort();<br>> #endif<br>> <br>> Look, no autoconf, and no fragile compiler version checks! :)<br>> <br>> I'll start working on this.<br>> <br>> -Chris<br>> _______________________________________________<br>> cfe-dev mailing list<br>> cfe-dev@cs.uiuc.edu<br>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br></div><br /><hr />Conheça os novos produtos Windows Live. <a href='http://www.windowslive.com.br' target='_new'>Clique aqui!</a></body>
</html>