This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] Add nextup and nextdown math functions
- From: Florian Weimer <fweimer at redhat dot com>
- To: Rajalakshmi Srinivasaraghavan <raji at linux dot vnet dot ibm dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 20 May 2016 10:31:23 +0200
- Subject: Re: [PATCH] Add nextup and nextdown math functions
- Authentication-results: sourceware.org; auth=none
- References: <1463727477-1909-1-git-send-email-raji at linux dot vnet dot ibm dot com>
On 05/20/2016 08:57 AM, Rajalakshmi Srinivasaraghavan wrote:
+# define FLOAT double
+# define NEXTAFTER nextafter
+# ifdef USE_AS_NEXTDOWN
+# define NEXTUP nextdown
+# define NEXTUP nextup
+#define INTERNAL(X) INTERNAL1(X)
+#define INTERNAL1(X) __##X
+INTERNAL(NEXTUP) (FLOAT x)
Would it make sense to have a file without defaults, and use #if
USE_AS_NEXTDOWN (instead of #ifdef USE_AS_NEXTDOWN)?
In the past, I think we had bugs because of typos or missing overrides
in such constructs, and if the template doesn't have defaults, such bugs
are less likely to happen.