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
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits