[cfe-commits] r64336 - in /cfe/trunk: include/clang/AST/Attr.h

Douglas Gregor dgregor at apple.com
Thu Feb 12 08:10:54 PST 2009


On Feb 12, 2009, at 8:02 AM, Douglas Gregor wrote:
> With macros, of course! :)
>
> float __tg_sin(float f) __attribute__((always_inline, overloadable))
> { return sinf(f); }
> double __tg_sin(double d) __attribute__((always_inline, overloadable))
> { return sin(d); }
> long double __tg_sin(long double ld) __attribute__((always_inline,
> overloadable)) { return sin(ld); }
> #define sin(x) __tg_sin(s)

Sorry, I got my attribute syntax mangled. That should be:

float __attribute__((always_inline, overloadable)) __tg_sin(float f)  
{ return sinf(f); }
double __attribute__((always_inline, overloadable)) __tg_sin(double d)  
{ return sin(d); }
long double __attribute__((always_inline, overloadable)) __tg_sin(long  
double ld) { return sin(ld); }
#define sin(x) __tg_sin(s)

	- Doug



More information about the cfe-commits mailing list