This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Using attribute cleanup for rounding mode save/restore


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~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]