Commit dcc41852 by Benjamin Kosnik Committed by Benjamin Kosnik

compare.cc (test01): Add using declarations.



2000-10-23  Benjamin Kosnik  <bkoz@redhat.com>

	* testsuite/21_strings/compare.cc (test01): Add using declarations.

	* include/c_std/bits/std_cerrno.h: And here.
	* include/c_std/bits/std_cassert.h: Tweaks.

	* mkcheck.in: Simplify.

	* acinclude.m4 (GLIBCPP_ENABLE_LONG_DOUBLE): Simplify.
	(GLIBCPP_ENABLE_LONG_LONG): Same.
	* aclocal.m4: Regenerate.

	* src/Makefile.am (c_shadow_headers): Add features.h,
	bits/wrap_features.h.
	* src/Makefile.in: Regenerate.
	* include/c_std/features.h: New file.
	* include/c_std/bits/wrap_features.h (_CPP_WRAP_FEATURES_H): New
	file. Need to have c++config.h included before this file so
	_ISOC99_SOURCE around.

	* include/c_std/sys/cdefs.h: Hack.
	* include/c_std/stdlib.h: Same, use c++config.h.
	* include/c_std/bits/std_cstdlib.h: Use _GLIBCPP_HAVE_STRTOLD.

	* include/c_std/bits/std_cassert.h: Fix.
	* include/c_std/bits/std_cerrno.h: Make consistent.

	* include/c_std/bits/std_csetjmp.h (setjmp): Unscope global
	declaration from ::_C_legacy to _C_legacy.

	* include/c_std/bits/std_cstdio.h: same with printf.
	* include/c_std/stdio.h: And here.

	* include/c_std/bits/std_cstdlib.h: abort, exit comment.
	* include/c_std/stdlib.h: Same here.

From-SVN: r37035
parent 060974d0
2000-10-23 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/21_strings/compare.cc (test01): Add using declarations.
* include/c_std/bits/std_cerrno.h: And here.
* include/c_std/bits/std_cassert.h: Tweaks.
* mkcheck.in: Simplify.
* acinclude.m4 (GLIBCPP_ENABLE_LONG_DOUBLE): Simplify.
(GLIBCPP_ENABLE_LONG_LONG): Same.
* aclocal.m4: Regenerate.
* src/Makefile.am (c_shadow_headers): Add features.h,
bits/wrap_features.h.
* src/Makefile.in: Regenerate.
* include/c_std/features.h: New file.
* include/c_std/bits/wrap_features.h (_CPP_WRAP_FEATURES_H): New
file. Need to have c++config.h included before this file so
_ISOC99_SOURCE around.
* include/c_std/sys/cdefs.h: Hack.
* include/c_std/stdlib.h: Same, use c++config.h.
* include/c_std/bits/std_cstdlib.h: Use _GLIBCPP_HAVE_STRTOLD.
* include/c_std/bits/std_cassert.h: Fix.
* include/c_std/bits/std_cerrno.h: Make consistent.
* include/c_std/bits/std_csetjmp.h (setjmp): Unscope global
declaration from ::_C_legacy to _C_legacy.
* include/c_std/bits/std_cstdio.h: same with printf.
* include/c_std/stdio.h: And here.
* include/c_std/bits/std_cstdlib.h: abort, exit comment.
* include/c_std/stdlib.h: Same here.
2000-10-21 Benjamin Kosnik <bkoz@purist.soma.redhat.com> 2000-10-21 Benjamin Kosnik <bkoz@purist.soma.redhat.com>
* acinclude.m4 (GLIBCPP_ENABLE_LONG_DOUBLE): New macro. * acinclude.m4 (GLIBCPP_ENABLE_LONG_DOUBLE): New macro.
......
...@@ -1404,10 +1404,9 @@ AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl ...@@ -1404,10 +1404,9 @@ AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
AC_MSG_RESULT($enable_long_long) AC_MSG_RESULT($enable_long_long)
dnl Option parsed, now set things appropriately dnl Option parsed, now set things appropriately
case "$enable_long_long" in if test x"$enable_long_long" = xyes; then
yes) AC_DEFINE(_GLIBCPP_USE_LONG_LONG) AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
;; fi
esac
]) ])
...@@ -1448,10 +1447,9 @@ AC_DEFUN(GLIBCPP_ENABLE_LONG_DOUBLE, [dnl ...@@ -1448,10 +1447,9 @@ AC_DEFUN(GLIBCPP_ENABLE_LONG_DOUBLE, [dnl
AC_MSG_RESULT($enable_long_double) AC_MSG_RESULT($enable_long_double)
dnl Option parsed, now set things appropriately dnl Option parsed, now set things appropriately
case "$enable_long_double" in if test x"$enable_long_double" = xyes; then
yes) AC_DEFINE(_GLIBCPP_USE_LONG_DOUBLE) AC_DEFINE(_GLIBCPP_USE_LONG_DOUBLE)
;; fi
esac
]) ])
......
...@@ -1416,10 +1416,9 @@ AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl ...@@ -1416,10 +1416,9 @@ AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
AC_MSG_RESULT($enable_long_long) AC_MSG_RESULT($enable_long_long)
dnl Option parsed, now set things appropriately dnl Option parsed, now set things appropriately
case "$enable_long_long" in if test x"$enable_long_long" = xyes; then
yes) AC_DEFINE(_GLIBCPP_USE_LONG_LONG) AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
;; fi
esac
]) ])
...@@ -1460,10 +1459,9 @@ AC_DEFUN(GLIBCPP_ENABLE_LONG_DOUBLE, [dnl ...@@ -1460,10 +1459,9 @@ AC_DEFUN(GLIBCPP_ENABLE_LONG_DOUBLE, [dnl
AC_MSG_RESULT($enable_long_double) AC_MSG_RESULT($enable_long_double)
dnl Option parsed, now set things appropriately dnl Option parsed, now set things appropriately
case "$enable_long_double" in if test x"$enable_long_double" = xyes; then
yes) AC_DEFINE(_GLIBCPP_USE_LONG_DOUBLE) AC_DEFINE(_GLIBCPP_USE_LONG_DOUBLE)
;; fi
esac
]) ])
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#include <cassert> #include <cassert>
// expose global C names, including non-standard ones, but shadow // Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version. // some names and types with the std:: C++ version.
#ifdef _ASSERT_NEED_C_LEGACY_ #ifdef _ASSERT_NEED_C_LEGACY_
......
...@@ -31,19 +31,31 @@ ...@@ -31,19 +31,31 @@
// ISO C++ 14882: 19.2 Assertions // ISO C++ 14882: 19.2 Assertions
// //
#ifndef _CPP_CASSERT // NB: This is assumed to be a conforming implementation.
#define _CPP_CASSERT 1
namespace _C_legacy { // ISO/IEC 9899:1999 (E), section 7.2
// assert.h
// ..defines the assert macro...
// ISO 14882
// 17.4.1.2 Headers
// ... declarations and definitions (except for macros) are within
// namespace scope of the namepace std...
//#ifndef _CPP_CASSERT
//#define _CPP_CASSERT 1
//namespace _C_legacy {
extern "C" { extern "C" {
# define _IN_C_LEGACY_ //# define _IN_C_LEGACY_
# pragma GCC system_header # pragma GCC system_header
# include_next <assert.h> # include_next <assert.h>
} }
} // namespace _C_legacy //} // namespace _C_legacy
#undef _IN_C_LEGACY_ //#undef _IN_C_LEGACY_
#endif //#endif
...@@ -33,26 +33,16 @@ ...@@ -33,26 +33,16 @@
#ifndef _CPP_CERRNO #ifndef _CPP_CERRNO
#define _CPP_CERRNO 1 #define _CPP_CERRNO 1
namespace _C_legacy { //namespace _C_legacy {
extern "C" { extern "C" {
# define _IN_C_LEGACY_ //# define _IN_C_LEGACY_
# pragma GCC system_header # pragma GCC system_header
# include_next <errno.h> # include_next <errno.h>
} }
//} // namespace _C_legacy::
// inline int& //# undef _IN_C_LEGACY_
// _CPP_errno_capture() { return errno; }
} // namespace _C_legacy::
# undef errno
//# define errno _C_legacy::_CPP_errno_capture()
namespace std {
using _C_legacy::errno;
}
# undef _IN_C_LEGACY_
#endif #endif
...@@ -46,7 +46,7 @@ namespace _C_legacy { ...@@ -46,7 +46,7 @@ namespace _C_legacy {
# undef jmp_buf # undef jmp_buf
# undef setjmp # undef setjmp
# define setjmp(__jb) ::_C_legacy::_CPP_setjmp_capture(__jb) # define setjmp(__jb) _C_legacy::_CPP_setjmp_capture(__jb)
# undef longjmp # undef longjmp
namespace std { namespace std {
......
...@@ -133,7 +133,7 @@ namespace std { ...@@ -133,7 +133,7 @@ namespace std {
using _C_legacy::remove; using _C_legacy::remove;
using _C_legacy::rename; using _C_legacy::rename;
using _C_legacy::tmpnam; using _C_legacy::tmpnam;
using _C_legacy::printf; // using _C_legacy::printf;
using _C_legacy::scanf; using _C_legacy::scanf;
using _C_legacy::sprintf; using _C_legacy::sprintf;
using _C_legacy::sscanf; using _C_legacy::sscanf;
......
...@@ -57,7 +57,6 @@ namespace _C_legacy { ...@@ -57,7 +57,6 @@ namespace _C_legacy {
# endif # endif
} // namespace _C_legacy } // namespace _C_legacy
# undef size_t
# undef wchar_t # undef wchar_t
# undef div_t # undef div_t
# undef ldiv_t # undef ldiv_t
...@@ -68,6 +67,9 @@ namespace _C_legacy { ...@@ -68,6 +67,9 @@ namespace _C_legacy {
# undef strtod # undef strtod
# undef strtol # undef strtol
# undef strtoul # undef strtoul
#ifdef _GLIBCPP_HAVE_STRTOLD
# undef strtold
#endif
# undef rand # undef rand
# undef srand # undef srand
# undef calloc # undef calloc
...@@ -124,9 +126,9 @@ namespace std { ...@@ -124,9 +126,9 @@ namespace std {
using _C_legacy::malloc; using _C_legacy::malloc;
using _C_legacy::realloc; using _C_legacy::realloc;
using _C_legacy::abort; // using _C_legacy::abort;
using _C_legacy::atexit; using _C_legacy::atexit;
using _C_legacy::exit; // using _C_legacy::exit;
using _C_legacy::bsearch; using _C_legacy::bsearch;
using _C_legacy::qsort; using _C_legacy::qsort;
...@@ -137,10 +139,14 @@ namespace std { ...@@ -137,10 +139,14 @@ namespace std {
using _C_legacy::mbstowcs; using _C_legacy::mbstowcs;
using _C_legacy::wcstombs; using _C_legacy::wcstombs;
using _C_legacy::strtof;
#ifdef _GLIBCPP_USE_LONG_LONG #ifdef _GLIBCPP_USE_LONG_LONG
using _C_legacy::strtoll; using _C_legacy::strtoll;
using _C_legacy::strtoull; using _C_legacy::strtoull;
using _C_legacy::strtof; #endif
#ifdef _GLIBCPP_HAVE_STRTOLD
using _C_legacy::strtold; using _C_legacy::strtold;
#endif #endif
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
// Expose global C names, including non-standard ones, but shadow // Expose global C names, including non-standard ones, but shadow
// some names and types with the std:: C++ version. // some names and types with the std:: C++ version.
using std::errno; // using std::errno;
# ifdef _ERRNO_NEED_C_LEGACY_ # ifdef _ERRNO_NEED_C_LEGACY_
// dive back into the "swamp" // dive back into the "swamp"
...@@ -53,3 +53,4 @@ ...@@ -53,3 +53,4 @@
# undef _ERRNO_NEED_C_LEGACY_ # undef _ERRNO_NEED_C_LEGACY_
# endif /* _ERRNO_NEED_C_LEGACY_ */ # endif /* _ERRNO_NEED_C_LEGACY_ */
#endif /* _INCLUDED_CPP_ERRNO_H_ */ #endif /* _INCLUDED_CPP_ERRNO_H_ */
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
using std::setvbuf; using std::setvbuf;
using std::fprintf; using std::fprintf;
using std::fscanf; using std::fscanf;
using std::printf; // using std::printf;
using std::scanf; using std::scanf;
using std::sprintf; using std::sprintf;
using std::sscanf; using std::sscanf;
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
#ifndef _INCLUDED_CPP_STDLIB_H_ #ifndef _INCLUDED_CPP_STDLIB_H_
# define _INCLUDED_CPP_STDLIB_H_ 1 # define _INCLUDED_CPP_STDLIB_H_ 1
# include <bits/c++config.h>
# ifdef _IN_C_LEGACY_ /* sub-included by a C header */ # ifdef _IN_C_LEGACY_ /* sub-included by a C header */
// get out of the "legacy" // get out of the "legacy"
} // close extern "C" } // close extern "C"
...@@ -49,7 +51,7 @@ ...@@ -49,7 +51,7 @@
using std::lldiv_t; using std::lldiv_t;
#endif #endif
using std::abort; // using std::abort;
using std::abs; using std::abs;
using std::atexit; using std::atexit;
using std::atof; using std::atof;
...@@ -58,7 +60,7 @@ ...@@ -58,7 +60,7 @@
using std::bsearch; using std::bsearch;
using std::calloc; using std::calloc;
using std::div; using std::div;
using std::exit; // using std::exit;
using std::free; using std::free;
using std::getenv; using std::getenv;
using std::labs; using std::labs;
...@@ -78,10 +80,14 @@ ...@@ -78,10 +80,14 @@
using std::wcstombs; using std::wcstombs;
using std::wctomb; using std::wctomb;
using std::strtof;
#ifdef _GLIBCPP_USE_LONG_LONG #ifdef _GLIBCPP_USE_LONG_LONG
using std::strtoll; using std::strtoll;
using std::strtoull; using std::strtoull;
using std::strtof; #endif
#ifdef _GLIBCPP_HAVE_STRTOLD
using std::strtold; using std::strtold;
#endif #endif
......
// -*- C++ -*- header wrapper. // -*- C++ -*- header wrapper.
// Copyright (C) 1997-1999 Free Software Foundation, Inc. // Copyright (C) 2000 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#ifndef _CPP_SYS_CDEFS_H #ifndef _CPP_SYS_CDEFS_H
# define _CPP_SYS_CDEFS_H # define _CPP_SYS_CDEFS_H 1
# pragma GCC system_header # pragma GCC system_header
# include_next <sys/cdefs.h> # include_next <sys/cdefs.h>
...@@ -40,4 +40,10 @@ ...@@ -40,4 +40,10 @@
#undef __END_DECLS #undef __END_DECLS
#define __END_DECLS #define __END_DECLS
#endif #endif /* _CPP_SYS_CDEFS_H_ */
...@@ -72,18 +72,16 @@ fi ...@@ -72,18 +72,16 @@ fi
#LIB_PATH == where to find the build library binaries. #LIB_PATH == where to find the build library binaries.
if [ $WHICH != "1" ]; then if [ $WHICH != "1" ]; then
LIB_PATH="$BUILD_DIR/src/.libs" LIB_PATH="$BUILD_DIR/src/.libs"
CXX="../../gcc/g++" CXX="$BUILD_DIR/../../gcc/g++ -B$BUILD_DIR/../../gcc/"
CXX_BASE="-B../../gcc/"
elif [ $WHICH -eq 1 ]; then elif [ $WHICH -eq 1 ]; then
LIB_PATH="$PREFIX_DIR/lib" LIB_PATH="$PREFIX_DIR/lib"
CXX="$PREFIX_DIR/bin/g++" CXX="$PREFIX_DIR/bin/g++"
CXX_BASE=""
fi fi
# gcc compiler flags # gcc compiler flags
#CXX_FLAG="-fsquangle -fhonor-std -fnew-exceptions -g -O2 -DDEBUG_ASSERT " #CXX_FLAG="-fsquangle -fhonor-std -fnew-exceptions -g -O2 -DDEBUG_ASSERT "
#CXX_FLAG="-g -O2 -DDEBUG_ASSERT " #CXX_FLAG="-g -O2 -DDEBUG_ASSERT "
CXX_FLAG="-g $CXX_BASE -DDEBUG_ASSERT @SECTION_FLAGS@ @SECTION_LDFLAGS@" CXX_FLAG="-g -DDEBUG_ASSERT @SECTION_FLAGS@ @SECTION_LDFLAGS@"
# a specific flag(s) to force the use of shared libraries, if any # a specific flag(s) to force the use of shared libraries, if any
SH_FLAG="" SH_FLAG=""
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
## USA. ## USA.
## $Id: Makefile.am,v 1.42 2000/10/17 10:12:23 bkoz Exp $ ## $Id: Makefile.am,v 1.43 2000/10/18 23:26:22 bkoz Exp $
AUTOMAKE_OPTIONS = 1.3 gnits AUTOMAKE_OPTIONS = 1.3 gnits
MAINT_CHARSET = latin1 MAINT_CHARSET = latin1
...@@ -136,8 +136,10 @@ c_shadow_headers = \ ...@@ -136,8 +136,10 @@ c_shadow_headers = \
assert.h ctype.h errno.h float.h limits.h locale.h math.h setjmp.h \ assert.h ctype.h errno.h float.h limits.h locale.h math.h setjmp.h \
signal.h stdarg.h stddef.h stdio.h stdlib.h string.h time.h wchar.h \ signal.h stdarg.h stddef.h stdio.h stdlib.h string.h time.h wchar.h \
wctype.h fcntl.h libio.h iolibio.h libioP.h pthread.h iconv.h \ wctype.h fcntl.h libio.h iolibio.h libioP.h pthread.h iconv.h \
features.h \
bits/wrap_libio.h bits/wrap_iolibio.h bits/wrap_libioP.h \ bits/wrap_libio.h bits/wrap_iolibio.h bits/wrap_libioP.h \
bits/wrap_iconv.h bits/wrap_fcntl.h bits/wrap_pthread.h \ bits/wrap_iconv.h bits/wrap_fcntl.h bits/wrap_pthread.h \
bits/wrap_features.h \
sys/cdefs.h sys/cdefs.h
if GLIBCPP_USE_CSHADOW if GLIBCPP_USE_CSHADOW
......
...@@ -146,7 +146,7 @@ base_headers = bits/cpp_type_traits.h bits/char_traits.h bits/codecvt.h bits/ ...@@ -146,7 +146,7 @@ base_headers = bits/cpp_type_traits.h bits/char_traits.h bits/codecvt.h bits/
c_base_headers = bits/std_cassert.h bits/std_cctype.h bits/std_cerrno.h bits/std_cfloat.h bits/std_climits.h bits/std_clocale.h bits/std_cmath.h bits/std_csetjmp.h bits/std_csignal.h bits/std_cstdarg.h bits/std_cstddef.h bits/std_cstdio.h bits/std_cstdlib.h bits/std_cstring.h bits/std_ctime.h bits/std_cwchar.h bits/std_cwctype.h c_base_headers = bits/std_cassert.h bits/std_cctype.h bits/std_cerrno.h bits/std_cfloat.h bits/std_climits.h bits/std_clocale.h bits/std_cmath.h bits/std_csetjmp.h bits/std_csignal.h bits/std_cstdarg.h bits/std_cstddef.h bits/std_cstdio.h bits/std_cstdlib.h bits/std_cstring.h bits/std_ctime.h bits/std_cwchar.h bits/std_cwctype.h
c_shadow_headers = assert.h ctype.h errno.h float.h limits.h locale.h math.h setjmp.h signal.h stdarg.h stddef.h stdio.h stdlib.h string.h time.h wchar.h wctype.h fcntl.h libio.h iolibio.h libioP.h pthread.h iconv.h bits/wrap_libio.h bits/wrap_iolibio.h bits/wrap_libioP.h bits/wrap_iconv.h bits/wrap_fcntl.h bits/wrap_pthread.h sys/cdefs.h c_shadow_headers = assert.h ctype.h errno.h float.h limits.h locale.h math.h setjmp.h signal.h stdarg.h stddef.h stdio.h stdlib.h string.h time.h wchar.h wctype.h fcntl.h libio.h iolibio.h libioP.h pthread.h iconv.h features.h bits/wrap_libio.h bits/wrap_iolibio.h bits/wrap_libioP.h bits/wrap_iconv.h bits/wrap_fcntl.h bits/wrap_pthread.h bits/wrap_features.h sys/cdefs.h
@GLIBCPP_USE_CSHADOW_TRUE@c_headers = $(c_base_headers) $(c_shadow_headers) @GLIBCPP_USE_CSHADOW_TRUE@c_headers = $(c_base_headers) $(c_shadow_headers)
@GLIBCPP_USE_CSHADOW_FALSE@c_headers = $(c_base_headers) @GLIBCPP_USE_CSHADOW_FALSE@c_headers = $(c_base_headers)
......
...@@ -75,6 +75,10 @@ test01() ...@@ -75,6 +75,10 @@ test01()
std::string str_1("costa marbella"); std::string str_1("costa marbella");
std::string str_2; std::string str_2;
using std::strcmp;
using std::strncmp;
using std::memcmp;
//sanity check //sanity check
test_value(strcmp("costa marbella", "costa rica"), lt); test_value(strcmp("costa marbella", "costa rica"), lt);
test_value(strcmp("costa rica", "costa rica"), z); test_value(strcmp("costa rica", "costa rica"), z);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment