* ilogbl: Fix compilation error with xlclang on AIX 7.2
@ 2021-01-06 11:02 Bruno Haible
0 siblings, 0 replies; only message in thread
From: Bruno Haible @ 2021-01-06 11:02 UTC (permalink / raw)
To: bug-gnulib
On AIX 7.2 with xlclang in 64-bit mode I see this compilation error:
xlclang -q64 -qthreaded -qtls -std=gnu11 -DHAVE_CONFIG_H -I. -I../../gllib -I.. -DGNULIB_STRICT_CHECKING=1 -I/home/haible/prefix64/include -D_THREAD_SAFE -g -O2 -MT math.o -MD -MP -MF .deps/math.Tpo -c -o math.o ../../gllib/math.c
In file included from ../../gllib/math.c:3:
./math.h:1832:19: error: function cannot return function type 'int (long double)'
_GL_FUNCDECL_SYS (ilogbl, int, (long double x));
^
1 error generated.
The reason is that in this situation, 'ilogbl' is defined as a macro.
This patch fixes it.
2021-01-06 Bruno Haible <bruno@clisp.org>
ilogbl: Fix compilation error with xlclang on AIX 7.2.
* lib/math.in.h (ilogbl): Undefine macro before declaration.
diff --git a/lib/math.in.h b/lib/math.in.h
index 6208a01..335505d 100644
--- a/lib/math.in.h
+++ b/lib/math.in.h
@@ -1322,6 +1322,7 @@ _GL_FUNCDECL_RPL (ilogbl, int, (long double x));
_GL_CXXALIAS_RPL (ilogbl, int, (long double x));
# else
# if !@HAVE_ILOGBL@
+# undef ilogbl
_GL_FUNCDECL_SYS (ilogbl, int, (long double x));
# endif
_GL_CXXALIAS_SYS (ilogbl, int, (long double x));
@@ -2102,7 +2103,7 @@ _GL_FUNCDECL_RPL (sinf, float, (float x));
_GL_CXXALIAS_RPL (sinf, float, (float x));
# else
# if !@HAVE_SINF@
- # undef sinf
+# undef sinf
_GL_FUNCDECL_SYS (sinf, float, (float x));
# endif
_GL_CXXALIAS_SYS (sinf, float, (float x));
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-01-06 11:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-06 11:02 ilogbl: Fix compilation error with xlclang on AIX 7.2 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).