This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Using attribute cleanup for rounding mode save/restore
- From: Richard Henderson <rth at twiddle dot net>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 06 Mar 2012 15:05:55 -0800
- Subject: Re: Using attribute cleanup for rounding mode save/restore
- Authentication-results: mr.google.com; spf=pass (google.com: domain of rth7680@gmail.com designates 10.52.20.142 as permitted sender) smtp.mail=rth7680@gmail.com; dkim=pass header.i=rth7680@gmail.com
- References: <4F568C45.3070802@twiddle.net> <20120306222758.2BB0A2C093@topped-with-meat.com>
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~