Problems with <tgmath.h>
Andreas Jaeger
aj@suse.de
Wed Dec 15 09:15:00 GMT 1999
>>>>> Daniel Jacobowitz writes:
> (Actually also with <bits/mathdef.h> and <math.h>)
> I ran in to two problems today. The first is that if both <math.h> and
> <complex.h> are included, the multiple inclusion of <bits/mathdef.h>
> causes float_t and double_t to get typedef'd twice, producing a
> warning.
Here's a patch for glibc 2.2. glibc 2.1 needs the same patch.
Andreas
1999-12-15 Andreas Jaeger <aj@suse.de>
* sysdeps/i386/fpu/bits/mathdef.h: Avoid double inclusion.
* sysdeps/sparc/fpu/bits/mathdef.h: Likewise.
* sysdeps/powerpc/fpu/bits/mathdef.h: Likewise.
* sysdeps/m68k/fpu/bits/mathdef.h: Likewise.
* sysdeps/generic/bits/mathdef.h: Likewise.
* sysdeps/alpha/fpu/bits/mathdef.h: Likewise.
============================================================
Index: sysdeps/i386/fpu/bits/mathdef.h
--- sysdeps/i386/fpu/bits/mathdef.h 1999/10/31 17:31:10 1.5
+++ sysdeps/i386/fpu/bits/mathdef.h 1999/12/15 16:54:14
@@ -20,6 +20,9 @@
# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
#endif
+#ifndef _BITS_MATHDEF_H
+#define _BITS_MATHDEF_H 1
+
#if defined __USE_ISOC99 && defined _MATH_H
/* The ix87 FPUs evaluate all values in the 80 bit floating-point format
which is also available for the user as `long double'. Therefore we
@@ -43,3 +46,5 @@
# define DECIMAL_DIG 18
#endif /* ISO C99 */
+
+#endif /* bits/mathdef.h */
============================================================
Index: sysdeps/sparc/fpu/bits/mathdef.h
--- sysdeps/sparc/fpu/bits/mathdef.h 1999/10/31 17:31:35 1.6
+++ sysdeps/sparc/fpu/bits/mathdef.h 1999/12/15 16:54:15
@@ -20,8 +20,12 @@
# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
#endif
+#ifndef _BITS_MATHDEF_H
+#define _BITS_MATHDEF_H 1
+
#include <bits/wordsize.h>
+
/* FIXME! This file describes properties of the compiler, not the machine;
it should not be part of libc! */
@@ -85,3 +89,5 @@
# endif
#endif
+
+#endif /* bits/mathdef.h */
============================================================
Index: sysdeps/powerpc/fpu/bits/mathdef.h
--- sysdeps/powerpc/fpu/bits/mathdef.h 1999/10/31 17:34:57 1.1
+++ sysdeps/powerpc/fpu/bits/mathdef.h 1999/12/15 16:54:15
@@ -27,6 +27,9 @@
FIXME! This file does not deal with the -fshort-double option of
gcc! */
+#ifndef _BITS_MATHDEF_H
+#define _BITS_MATHDEF_H 1
+
#if defined __USE_ISOC99 && defined _MATH_H
# ifdef __GNUC__
# if __STDC__ == 1
@@ -86,3 +89,5 @@
declaration of all the `long double' function variants. */
# define __NO_LONG_DOUBLE_MATH 1
#endif
+
+#endif /* bits/mathdef.h */
============================================================
Index: sysdeps/m68k/fpu/bits/mathdef.h
--- sysdeps/m68k/fpu/bits/mathdef.h 1999/10/31 17:31:25 1.7
+++ sysdeps/m68k/fpu/bits/mathdef.h 1999/12/15 16:54:15
@@ -20,6 +20,9 @@
# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
#endif
+#ifndef _BITS_MATHDEF_H
+#define _BITS_MATHDEF_H 1
+
#if defined __USE_ISOC99 && defined _MATH_H
/* The m68k FPUs evaluate all values in the 96 bit floating-point format
which is also available for the user as `long double'. Therefore we
@@ -43,3 +46,5 @@
# define DECIMAL_DIG 18
#endif /* ISO C99 */
+
+#endif /* bits/mathdef.h */
============================================================
Index: sysdeps/generic/bits/mathdef.h
--- sysdeps/generic/bits/mathdef.h 1999/10/31 17:30:59 1.6
+++ sysdeps/generic/bits/mathdef.h 1999/12/15 16:54:15
@@ -20,6 +20,9 @@
# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
#endif
+#ifndef _BITS_MATHDEF_H
+#define _BITS_MATHDEF_H 1
+
#if defined __USE_ISOC99 && defined _MATH_H
/* Normally, there is no long double type and the `float' and `double'
expressions are evaluated as `double'. */
@@ -49,3 +52,5 @@
declaration of all the `long double' function variants. */
# define __NO_LONG_DOUBLE_MATH 1
#endif
+
+#endif /* bits/mathdef.h */
============================================================
Index: sysdeps/alpha/fpu/bits/mathdef.h
--- sysdeps/alpha/fpu/bits/mathdef.h 1999/10/31 17:30:51 1.5
+++ sysdeps/alpha/fpu/bits/mathdef.h 1999/12/15 16:54:15
@@ -23,6 +23,9 @@
/* FIXME! This file describes properties of the compiler, not the machine;
it should not be part of libc! */
+#ifndef _BITS_MATHDEF_H
+#define _BITS_MATHDEF_H 1
+
#if defined __USE_ISOC99 && defined _MATH_H
# ifdef __GNUC__
# if __STDC__ == 1
@@ -78,3 +81,5 @@
declaration of all the `long double' function variants. */
# define __NO_LONG_DOUBLE_MATH 1
#endif
+
+#endif /* bits/mathdef.h */
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.rhein-neckar.de
More information about the Libc-alpha
mailing list