bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* fix compilation errors on HP-UX 11/ia64
@ 2019-12-08 21:54 Bruno Haible
  0 siblings, 0 replies; only message in thread
From: Bruno Haible @ 2019-12-08 21:54 UTC (permalink / raw
  To: bug-gnulib

On HP-UX 11.31/ia64 I'm seeing these errors:

DEPDIR=.deps depmode=hp2 /bin/sh ../../build-aux/depcomp \
cc +DD64 -AC99 -D_XOPEN_SOURCE=500 -DHAVE_CONFIG_H -I. -I../../gllib -I..  -DGNULIB_STRICT_CHECKING=1 -I/home/haible/prefix-hpux113ia64-64-cc/include  -g -c -o math.o ../../gllib/math.c
"./math.h", line 977: error #2040: expected an identifier
  _GL_FUNCDECL_SYS (copysignf, float, (float x, float y));
  ^

"./math.h", line 977: error #2018: expected a ")"
  _GL_FUNCDECL_SYS (copysignf, float, (float x, float y));
  ^

"./math.h", line 1388: error #2040: expected an identifier
  _GL_FUNCDECL_SYS (fmaf, float, (float x, float y, float z));
  ^

"./math.h", line 1388: error #2018: expected a ")"
  _GL_FUNCDECL_SYS (fmaf, float, (float x, float y, float z));
  ^

"./math.h", line 1411: error #2040: expected an identifier
  _GL_FUNCDECL_SYS (fma, double, (double x, double y, double z));
  ^

"./math.h", line 1411: error #2018: expected a ")"
  _GL_FUNCDECL_SYS (fma, double, (double x, double y, double z));
  ^

6 errors detected in the compilation of "../../gllib/math.c".
gmake[4]: *** [math.o] Error 2


This patch fixes it.


2019-12-08  Bruno Haible  <bruno@clisp.org>

	Fix compilation errors on HP-UX 11/ia64.
	* lib/math.in.h (copysignf, fmaf, fma): Undefine before
	_GL_FUNCDECL_SYS.

diff --git a/lib/math.in.h b/lib/math.in.h
index 55130ab..18f8ff3 100644
--- a/lib/math.in.h
+++ b/lib/math.in.h
@@ -500,6 +500,7 @@ _GL_WARN_ON_USE (ceill, "ceill is unportable - "
 
 #if @GNULIB_COPYSIGNF@
 # if !@HAVE_DECL_COPYSIGNF@
+#  undef copysignf
 _GL_FUNCDECL_SYS (copysignf, float, (float x, float y));
 # endif
 _GL_CXXALIAS_SYS (copysignf, float, (float x, float y));
@@ -911,6 +912,7 @@ _GL_FUNCDECL_RPL (fmaf, float, (float x, float y, float z));
 _GL_CXXALIAS_RPL (fmaf, float, (float x, float y, float z));
 # else
 #  if !@HAVE_FMAF@
+#   undef fmaf
 _GL_FUNCDECL_SYS (fmaf, float, (float x, float y, float z));
 #  endif
 _GL_CXXALIAS_SYS (fmaf, float, (float x, float y, float z));
@@ -934,6 +936,7 @@ _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@
+#   undef fma
 _GL_FUNCDECL_SYS (fma, double, (double x, double y, double z));
 #  endif
 _GL_CXXALIAS_SYS (fma, double, (double x, double y, double z));



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-12-08 21:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-08 21:54 fix compilation errors on HP-UX 11/ia64 Bruno Haible

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).