Using attribute cleanup for rounding mode save/restore

Richard Henderson rth@twiddle.net
Tue Mar 6 23:06:00 GMT 2012


On 03/06/12 14:27, Roland McGrath wrote:
> Is there a reason we don't just make the sysdeps defns of libc_feupdateenv
> et al be inlines instead of macros?

Probably just to make them easy to override.
Otherwise we have to do things like

--- sysdeps/x86_64/fpu/math_private.h

static inline void libc_feholdexcept(fenv_t *e) { ... }
#define libc_feholdexcept  libc_feholdexcept
#define libc_feholdexceptf libc_feholdexcept

#include <math/math_private.h>

--- math/math_private.h

#ifndef libc_feholdexcept
static inline void libc_feholdexcept(fenv_t *e) { ... }
#endif
#ifndef libc_feholdexceptf
static inline void libc_feholdexceptf(fenv_t *e) { ... }
#endif

---

rather than the current set of #define/#undefs.

I guess that's really no more awkward than any other solution.

Also, we'd want to adjust math_private.h to include <fenv.h>
early enough, but that's obviously not a big deal...


r~



More information about the Libc-alpha mailing list