diff lib/math.in.h @ 16038:8f14d00d6f24

New module 'fma'. * lib/math.in.h (fma): New declaration. * lib/fma.c: New file. * m4/fma.m4: New file. * m4/fegetround.m4: New file. * m4/math_h.m4 (gl_MATH_H): Test whethern fma is declared. (gl_MATH_H_DEFAULTS): Initialize GNULIB_FMA, HAVE_FMA, REPLACE_FMA. * modules/math (Makefile.am): Substitute GNULIB_FMA, HAVE_FMA, REPLACE_FMA. * modules/fma: New file. * doc/posix-functions/fma.texi: Mention the new module and the various bugs.
author Bruno Haible <bruno@clisp.org>
date Mon, 17 Oct 2011 23:48:01 +0200
parents a63613865d90
children b8acd8099b25
line wrap: on
line diff
--- a/lib/math.in.h
+++ b/lib/math.in.h
@@ -507,6 +507,30 @@
 #endif
 
 
+#if @GNULIB_FMA@
+# if @REPLACE_FMA@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fma
+#   define fma rpl_fma
+#  endif
+_GL_FUNCDECL_RPL (fma, double, (double x, double y, double z));
+_GL_CXXALIAS_RPL (fma, double, (double x, double y, double z));
+# else
+#  if !@HAVE_FMA@
+_GL_FUNCDECL_SYS (fma, double, (double x, double y, double z));
+#  endif
+_GL_CXXALIAS_SYS (fma, double, (double x, double y, double z));
+# endif
+_GL_CXXALIASWARN (fma);
+#elif defined GNULIB_POSIXCHECK
+# undef fma
+# if HAVE_RAW_DECL_FMA
+_GL_WARN_ON_USE (fma, "fma is unportable - "
+                 "use gnulib module fma for portability");
+# endif
+#endif
+
+
 #if @GNULIB_FMODF@
 # if !@HAVE_FMODF@
 #  undef fmodf