mirror of git://gcc.gnu.org/git/gcc.git
cstdint: New.
2006-01-29 Paolo Carlini <pcarlini@suse.de> * include/tr1/cstdint: New. * include/Makefile.am: Add. * testsuite/tr1/8_c_compatibility/cstdint/types: New. * acinclude.m4 ([GLIBCXX_CHECK_C99_TR1]): Add <stdint.h> checks. * docs/html/ext/tr1.html: Update. * include/Makefile.in: Regenerate. * config.h.in: Likewise. * configure: Likewise. * testsuite/tr1/8_c_compatibility/cfenv/types.cc: Cosmetic tweak. From-SVN: r110378
This commit is contained in:
parent
b31305861a
commit
2a1d634643
|
@ -1,3 +1,16 @@
|
||||||
|
2006-01-29 Paolo Carlini <pcarlini@suse.de>
|
||||||
|
|
||||||
|
* include/tr1/cstdint: New.
|
||||||
|
* include/Makefile.am: Add.
|
||||||
|
* testsuite/tr1/8_c_compatibility/cstdint/types: New.
|
||||||
|
* acinclude.m4 ([GLIBCXX_CHECK_C99_TR1]): Add <stdint.h> checks.
|
||||||
|
* docs/html/ext/tr1.html: Update.
|
||||||
|
* include/Makefile.in: Regenerate.
|
||||||
|
* config.h.in: Likewise.
|
||||||
|
* configure: Likewise.
|
||||||
|
|
||||||
|
* testsuite/tr1/8_c_compatibility/cfenv/types.cc: Cosmetic tweak.
|
||||||
|
|
||||||
2006-01-29 Paolo Carlini <pcarlini@suse.de>
|
2006-01-29 Paolo Carlini <pcarlini@suse.de>
|
||||||
|
|
||||||
PR libstdc++/26006
|
PR libstdc++/26006
|
||||||
|
|
|
@ -1140,6 +1140,47 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [
|
||||||
<tr1/cfenv> in namespace std::tr1.])
|
<tr1/cfenv> in namespace std::tr1.])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check for the existence of <stdint.h> types.
|
||||||
|
AC_MSG_CHECKING([for ISO C99 support to TR1 in <stdint.h>])
|
||||||
|
AC_CACHE_VAL(ac_c99_stdint_tr1, [
|
||||||
|
AC_TRY_COMPILE([#include <stdint.h>],
|
||||||
|
[typedef int8_t my_int8_t;
|
||||||
|
typedef int16_t my_int16_t;
|
||||||
|
typedef int32_t my_int32_t;
|
||||||
|
typedef int64_t my_int64_t;
|
||||||
|
typedef int_fast8_t my_int_fast8_t;
|
||||||
|
typedef int_fast16_t my_int_fast16_t;
|
||||||
|
typedef int_fast32_t my_int_fast32_t;
|
||||||
|
typedef int_fast64_t my_int_fast64_t;
|
||||||
|
typedef int_least8_t my_int_least8_t;
|
||||||
|
typedef int_least16_t my_int_least16_t;
|
||||||
|
typedef int_least32_t my_int_least32_t;
|
||||||
|
typedef int_least64_t my_int_least64_t;
|
||||||
|
typedef intmax_t my_intmax_t;
|
||||||
|
typedef intptr_t my_intptr_t;
|
||||||
|
typedef uint8_t my_uint8_t;
|
||||||
|
typedef uint16_t my_uint16_t;
|
||||||
|
typedef uint32_t my_uint32_t;
|
||||||
|
typedef uint64_t my_uint64_t;
|
||||||
|
typedef uint_fast8_t my_uint_fast8_t;
|
||||||
|
typedef uint_fast16_t my_uint_fast16_t;
|
||||||
|
typedef uint_fast32_t my_uint_fast32_t;
|
||||||
|
typedef uint_fast64_t my_uint_fast64_t;
|
||||||
|
typedef uint_least8_t my_uint_least8_t;
|
||||||
|
typedef uint_least16_t my_uint_least16_t;
|
||||||
|
typedef uint_least32_t my_uint_least32_t;
|
||||||
|
typedef uint_least64_t my_uint_least64_t;
|
||||||
|
typedef uintmax_t my_uintmax_t;
|
||||||
|
typedef uintptr_t my_uintptr_t;
|
||||||
|
],[ac_c99_stdint_tr1=yes], [ac_c99_stdint_tr1=no])
|
||||||
|
])
|
||||||
|
AC_MSG_RESULT($ac_c99_stdint_tr1)
|
||||||
|
if test x"$ac_c99_stdint_tr1" = x"yes"; then
|
||||||
|
AC_DEFINE(_GLIBCXX_USE_C99_STDINT_TR1, 1,
|
||||||
|
[Define if C99 types in <stdint.h> should be imported in
|
||||||
|
<tr1/cstdint> in namespace std::tr1.])
|
||||||
|
fi
|
||||||
|
|
||||||
AC_LANG_RESTORE
|
AC_LANG_RESTORE
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
|
@ -711,6 +711,10 @@
|
||||||
in namespace std. */
|
in namespace std. */
|
||||||
#undef _GLIBCXX_USE_C99_MATH
|
#undef _GLIBCXX_USE_C99_MATH
|
||||||
|
|
||||||
|
/* Define if C99 types in <stdint.h> should be imported in <tr1/cstdint> in
|
||||||
|
namespace std::tr1. */
|
||||||
|
#undef _GLIBCXX_USE_C99_STDINT_TR1
|
||||||
|
|
||||||
/* Define if iconv and related functions exist and are usable. */
|
/* Define if iconv and related functions exist and are usable. */
|
||||||
#undef _GLIBCXX_USE_ICONV
|
#undef _GLIBCXX_USE_ICONV
|
||||||
|
|
||||||
|
|
|
@ -30517,6 +30517,99 @@ _ACEOF
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check for the existence of <stdint.h> types.
|
||||||
|
echo "$as_me:$LINENO: checking for ISO C99 support to TR1 in <stdint.h>" >&5
|
||||||
|
echo $ECHO_N "checking for ISO C99 support to TR1 in <stdint.h>... $ECHO_C" >&6
|
||||||
|
if test "${ac_c99_stdint_tr1+set}" = set; then
|
||||||
|
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||||
|
else
|
||||||
|
|
||||||
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
|
/* confdefs.h. */
|
||||||
|
_ACEOF
|
||||||
|
cat confdefs.h >>conftest.$ac_ext
|
||||||
|
cat >>conftest.$ac_ext <<_ACEOF
|
||||||
|
/* end confdefs.h. */
|
||||||
|
#include <stdint.h>
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
typedef int8_t my_int8_t;
|
||||||
|
typedef int16_t my_int16_t;
|
||||||
|
typedef int32_t my_int32_t;
|
||||||
|
typedef int64_t my_int64_t;
|
||||||
|
typedef int_fast8_t my_int_fast8_t;
|
||||||
|
typedef int_fast16_t my_int_fast16_t;
|
||||||
|
typedef int_fast32_t my_int_fast32_t;
|
||||||
|
typedef int_fast64_t my_int_fast64_t;
|
||||||
|
typedef int_least8_t my_int_least8_t;
|
||||||
|
typedef int_least16_t my_int_least16_t;
|
||||||
|
typedef int_least32_t my_int_least32_t;
|
||||||
|
typedef int_least64_t my_int_least64_t;
|
||||||
|
typedef intmax_t my_intmax_t;
|
||||||
|
typedef intptr_t my_intptr_t;
|
||||||
|
typedef uint8_t my_uint8_t;
|
||||||
|
typedef uint16_t my_uint16_t;
|
||||||
|
typedef uint32_t my_uint32_t;
|
||||||
|
typedef uint64_t my_uint64_t;
|
||||||
|
typedef uint_fast8_t my_uint_fast8_t;
|
||||||
|
typedef uint_fast16_t my_uint_fast16_t;
|
||||||
|
typedef uint_fast32_t my_uint_fast32_t;
|
||||||
|
typedef uint_fast64_t my_uint_fast64_t;
|
||||||
|
typedef uint_least8_t my_uint_least8_t;
|
||||||
|
typedef uint_least16_t my_uint_least16_t;
|
||||||
|
typedef uint_least32_t my_uint_least32_t;
|
||||||
|
typedef uint_least64_t my_uint_least64_t;
|
||||||
|
typedef uintmax_t my_uintmax_t;
|
||||||
|
typedef uintptr_t my_uintptr_t;
|
||||||
|
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
rm -f conftest.$ac_objext
|
||||||
|
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||||
|
(eval $ac_compile) 2>conftest.er1
|
||||||
|
ac_status=$?
|
||||||
|
grep -v '^ *+' conftest.er1 >conftest.err
|
||||||
|
rm -f conftest.er1
|
||||||
|
cat conftest.err >&5
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); } &&
|
||||||
|
{ ac_try='test -z "$ac_cxx_werror_flag"
|
||||||
|
|| test ! -s conftest.err'
|
||||||
|
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||||
|
(eval $ac_try) 2>&5
|
||||||
|
ac_status=$?
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); }; } &&
|
||||||
|
{ ac_try='test -s conftest.$ac_objext'
|
||||||
|
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||||
|
(eval $ac_try) 2>&5
|
||||||
|
ac_status=$?
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); }; }; then
|
||||||
|
ac_c99_stdint_tr1=yes
|
||||||
|
else
|
||||||
|
echo "$as_me: failed program was:" >&5
|
||||||
|
sed 's/^/| /' conftest.$ac_ext >&5
|
||||||
|
|
||||||
|
ac_c99_stdint_tr1=no
|
||||||
|
fi
|
||||||
|
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$as_me:$LINENO: result: $ac_c99_stdint_tr1" >&5
|
||||||
|
echo "${ECHO_T}$ac_c99_stdint_tr1" >&6
|
||||||
|
if test x"$ac_c99_stdint_tr1" = x"yes"; then
|
||||||
|
|
||||||
|
cat >>confdefs.h <<\_ACEOF
|
||||||
|
#define _GLIBCXX_USE_C99_STDINT_TR1 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
ac_ext=c
|
ac_ext=c
|
||||||
ac_cpp='$CPP $CPPFLAGS'
|
ac_cpp='$CPP $CPPFLAGS'
|
||||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||||
|
|
|
@ -2043,25 +2043,25 @@ release.
|
||||||
<tr>
|
<tr>
|
||||||
<td>8.22</td>
|
<td>8.22</td>
|
||||||
<td>The header <code><cstdint></code></td>
|
<td>The header <code><cstdint></code></td>
|
||||||
|
<td>done</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>missing</td>
|
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>8.22.1</td>
|
<td>8.22.1</td>
|
||||||
<td>Synopsis</td>
|
<td>Synopsis</td>
|
||||||
|
<td>done</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>missing</td>
|
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>8.22.2</td>
|
<td>8.22.2</td>
|
||||||
<td>Definitions</td>
|
<td>Definitions</td>
|
||||||
|
<td>done</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>missing</td>
|
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -488,6 +488,7 @@ tr1_headers = \
|
||||||
${tr1_srcdir}/cfenv \
|
${tr1_srcdir}/cfenv \
|
||||||
${tr1_srcdir}/common.h \
|
${tr1_srcdir}/common.h \
|
||||||
${tr1_srcdir}/complex \
|
${tr1_srcdir}/complex \
|
||||||
|
${tr1_srcdir}/cstdint \
|
||||||
${tr1_srcdir}/functional \
|
${tr1_srcdir}/functional \
|
||||||
${tr1_srcdir}/functional_iterate.h \
|
${tr1_srcdir}/functional_iterate.h \
|
||||||
${tr1_srcdir}/hashtable \
|
${tr1_srcdir}/hashtable \
|
||||||
|
|
|
@ -705,6 +705,7 @@ tr1_headers = \
|
||||||
${tr1_srcdir}/cfenv \
|
${tr1_srcdir}/cfenv \
|
||||||
${tr1_srcdir}/common.h \
|
${tr1_srcdir}/common.h \
|
||||||
${tr1_srcdir}/complex \
|
${tr1_srcdir}/complex \
|
||||||
|
${tr1_srcdir}/cstdint \
|
||||||
${tr1_srcdir}/functional \
|
${tr1_srcdir}/functional \
|
||||||
${tr1_srcdir}/functional_iterate.h \
|
${tr1_srcdir}/functional_iterate.h \
|
||||||
${tr1_srcdir}/hashtable \
|
${tr1_srcdir}/hashtable \
|
||||||
|
|
|
@ -0,0 +1,94 @@
|
||||||
|
// TR1 cstdint -*- C++ -*-
|
||||||
|
|
||||||
|
// Copyright (C) 2006 Free Software Foundation, Inc.
|
||||||
|
//
|
||||||
|
// This file is part of the GNU ISO C++ Library. This library is free
|
||||||
|
// software; you can redistribute it and/or modify it under the
|
||||||
|
// terms of the GNU General Public License as published by the
|
||||||
|
// Free Software Foundation; either version 2, or (at your option)
|
||||||
|
// any later version.
|
||||||
|
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
|
// You should have received a copy of the GNU General Public License along
|
||||||
|
// with this library; see the file COPYING. If not, write to the Free
|
||||||
|
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
// USA.
|
||||||
|
|
||||||
|
// As a special exception, you may use this file as part of a free software
|
||||||
|
// library without restriction. Specifically, if other files instantiate
|
||||||
|
// templates or use macros or inline functions from this file, or you compile
|
||||||
|
// this file and link it with other files to produce an executable, this
|
||||||
|
// file does not by itself cause the resulting executable to be covered by
|
||||||
|
// the GNU General Public License. This exception does not however
|
||||||
|
// invalidate any other reasons why the executable file might be covered by
|
||||||
|
// the GNU General Public License.
|
||||||
|
|
||||||
|
/** @file
|
||||||
|
* This is a TR1 C++ Library header.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _TR1_CSTDINT
|
||||||
|
#define _TR1_CSTDINT 1
|
||||||
|
|
||||||
|
#include <bits/c++config.h>
|
||||||
|
|
||||||
|
#if _GLIBCXX_HAVE_STDINT_H
|
||||||
|
// 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
|
||||||
|
{
|
||||||
|
_GLIBCXX_BEGIN_NAMESPACE(tr1)
|
||||||
|
|
||||||
|
using ::int8_t;
|
||||||
|
using ::int16_t;
|
||||||
|
using ::int32_t;
|
||||||
|
using ::int64_t;
|
||||||
|
|
||||||
|
using ::int_fast8_t;
|
||||||
|
using ::int_fast16_t;
|
||||||
|
using ::int_fast32_t;
|
||||||
|
using ::int_fast64_t;
|
||||||
|
|
||||||
|
using ::int_least8_t;
|
||||||
|
using ::int_least16_t;
|
||||||
|
using ::int_least32_t;
|
||||||
|
using ::int_least64_t;
|
||||||
|
|
||||||
|
using ::intmax_t;
|
||||||
|
using ::intptr_t;
|
||||||
|
|
||||||
|
using ::uint8_t;
|
||||||
|
using ::uint16_t;
|
||||||
|
using ::uint32_t;
|
||||||
|
using ::uint64_t;
|
||||||
|
|
||||||
|
using ::uint_fast8_t;
|
||||||
|
using ::uint_fast16_t;
|
||||||
|
using ::uint_fast32_t;
|
||||||
|
using ::uint_fast64_t;
|
||||||
|
|
||||||
|
using ::uint_least8_t;
|
||||||
|
using ::uint_least16_t;
|
||||||
|
using ::uint_least32_t;
|
||||||
|
using ::uint_least64_t;
|
||||||
|
|
||||||
|
using ::uintmax_t;
|
||||||
|
using ::uintptr_t;
|
||||||
|
|
||||||
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
|
@ -29,8 +29,8 @@ void test01()
|
||||||
#if _GLIBCXX_USE_C99_FENV_TR1
|
#if _GLIBCXX_USE_C99_FENV_TR1
|
||||||
|
|
||||||
// Check for required typedefs
|
// Check for required typedefs
|
||||||
typedef std::tr1::fenv_t fenv_t_type;
|
typedef std::tr1::fenv_t my_fenv_t;
|
||||||
typedef std::tr1::fexcept_t fexcept_t_type;
|
typedef std::tr1::fexcept_t my_fexcept_t;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
// { dg-do compile }
|
||||||
|
|
||||||
|
// 2006-01-29 Paolo Carlini <pcarlini@suse.de>
|
||||||
|
//
|
||||||
|
// Copyright (C) 2006 Free Software Foundation, Inc.
|
||||||
|
//
|
||||||
|
// This file is part of the GNU ISO C++ Library. This library is free
|
||||||
|
// software; you can redistribute it and/or modify it under the
|
||||||
|
// terms of the GNU General Public License as published by the
|
||||||
|
// Free Software Foundation; either version 2, or (at your option)
|
||||||
|
// any later version.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License along
|
||||||
|
// with this library; see the file COPYING. If not, write to the Free
|
||||||
|
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
// USA.
|
||||||
|
|
||||||
|
// 8.22 Header <cstdint>
|
||||||
|
|
||||||
|
#include <tr1/cstdint>
|
||||||
|
|
||||||
|
void test01()
|
||||||
|
{
|
||||||
|
#if _GLIBCXX_USE_C99_STDINT_TR1
|
||||||
|
|
||||||
|
typedef int8_t my_int8_t;
|
||||||
|
typedef int16_t my_int16_t;
|
||||||
|
typedef int32_t my_int32_t;
|
||||||
|
typedef int64_t my_int64_t;
|
||||||
|
typedef int_fast8_t my_int_fast8_t;
|
||||||
|
typedef int_fast16_t my_int_fast16_t;
|
||||||
|
typedef int_fast32_t my_int_fast32_t;
|
||||||
|
typedef int_fast64_t my_int_fast64_t;
|
||||||
|
typedef int_least8_t my_int_least8_t;
|
||||||
|
typedef int_least16_t my_int_least16_t;
|
||||||
|
typedef int_least32_t my_int_least32_t;
|
||||||
|
typedef int_least64_t my_int_least64_t;
|
||||||
|
typedef intmax_t my_intmax_t;
|
||||||
|
typedef intptr_t my_intptr_t;
|
||||||
|
typedef uint8_t my_uint8_t;
|
||||||
|
typedef uint16_t my_uint16_t;
|
||||||
|
typedef uint32_t my_uint32_t;
|
||||||
|
typedef uint64_t my_uint64_t;
|
||||||
|
typedef uint_fast8_t my_uint_fast8_t;
|
||||||
|
typedef uint_fast16_t my_uint_fast16_t;
|
||||||
|
typedef uint_fast32_t my_uint_fast32_t;
|
||||||
|
typedef uint_fast64_t my_uint_fast64_t;
|
||||||
|
typedef uint_least8_t my_uint_least8_t;
|
||||||
|
typedef uint_least16_t my_uint_least16_t;
|
||||||
|
typedef uint_least32_t my_uint_least32_t;
|
||||||
|
typedef uint_least64_t my_uint_least64_t;
|
||||||
|
typedef uintmax_t my_uintmax_t;
|
||||||
|
typedef uintptr_t my_uintptr_t;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
}
|
Loading…
Reference in New Issue