This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH/RFC] libstdc++'s tr1/cstdint vs. IRIX's stdint.h
Hi everyone (just back from a few days of vacations),
I'm not really sure the best way to fix this. Conceptually, it would
make sense of libstdc++ to use the C++ compiler to detect whether
headers
are available. Unfortunately, my autoconf-foo isn't clever enough for
that.
You can try sticking AC_LANG_CPLUSPLUS somewhere at the top of
libstdc++ configure.ac.
Indeed, this is a very good point/idea, which should be fully explored.
For now, for 4.2.0, seems a bit too risky (currently we have got a messy
;) mix of C++ and C tests...) and I would rather fix IRIX with the
below, which I'm lightly testing. Unless you can figure out serious
problems with it, tomorrow I will go ahead and apply it.
Thanks,
Paolo.
////////////
2006-07-24 Paolo Carlini <pcarlini@suse.de>
* include/tr1/cinttypes: Simply protect everything with
_GLIBCXX_USE_C99_INTTYPES_TR1.
* include/tr1/cfenv: Likewise with _GLIBCXX_USE_C99_FENV_TR1.
* include/tr1/cstdint: Likewise with _GLIBCXX_USE_C99_STDINT_TR1.
Index: include/tr1/cinttypes
===================================================================
--- include/tr1/cinttypes (revision 115684)
+++ include/tr1/cinttypes (working copy)
@@ -35,17 +35,14 @@
#define _TR1_CINTTYPES 1
#include <bits/c++config.h>
-
#include <tr1/cstdint>
-#if _GLIBCXX_HAVE_INTTYPES_H
+#if _GLIBCXX_USE_C99_INTTYPES_TR1
+
// For 8.11.1/1 (see C99, Note 184)
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
-#endif
-#if _GLIBCXX_USE_C99_INTTYPES_TR1
-
// namespace std::tr1
namespace std
{
Index: include/tr1/cfenv
===================================================================
--- include/tr1/cfenv (revision 115684)
+++ include/tr1/cfenv (working copy)
@@ -36,12 +36,10 @@
#include <bits/c++config.h>
-#if _GLIBCXX_HAVE_FENV_H
-#include <fenv.h>
-#endif
-
#if _GLIBCXX_USE_C99_FENV_TR1
+#include <fenv.h>
+
#undef feclearexcept
#undef fegetexceptflag
#undef feraiseexcept
Index: include/tr1/cstdint
===================================================================
--- include/tr1/cstdint (revision 115684)
+++ include/tr1/cstdint (working copy)
@@ -36,15 +36,13 @@
#include <bits/c++config.h>
-#if _GLIBCXX_HAVE_STDINT_H
+#if _GLIBCXX_USE_C99_STDINT_TR1
+
// For 8.22.1/1 (see C99, Notes 219, 220, 222)
#define __STDC_LIMIT_MACROS
#define __STDC_CONSTANT_MACROS
#include <stdint.h>
-#endif
-#if _GLIBCXX_USE_C99_STDINT_TR1
-
// namespace std::tr1
namespace std
{