[multiple changes]
authorBenjamin Kosnik <bkoz@gcc.gnu.org>
Tue, 19 Dec 2000 22:55:07 +0000 (22:55 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Tue, 19 Dec 2000 22:55:07 +0000 (22:55 +0000)
2000-12-19  Benjamin Kosnik  <bkoz@fillmore.constant.com>

* configure.in: Don't turn on long long by default.
* configure: Regenerate.
* include/c/bits/std_cstdio.h: Remove c++config.h include.
* src/locale.cc: Formatting tweaks.
* testsuite/22_locale/ctype.cc (char<unsigned char>): Provide
member functions.

2000-12-19  Loren J. Rittle  <ljrittle@acm.org>

        * testsuite/22_locale/ctype.cc (test01): Correct ~ operator usage.

From-SVN: r38388

libstdc++-v3/ChangeLog
libstdc++-v3/configure
libstdc++-v3/configure.in
libstdc++-v3/include/c/bits/std_cstdio.h
libstdc++-v3/src/locale.cc
libstdc++-v3/testsuite/22_locale/ctype.cc

index 6215967e0e7f1e715a93ab1d17ccae3ab849559f..31c4a10bfc8d38aef66854dde9031c01479d0bad 100644 (file)
@@ -1,3 +1,16 @@
+2000-12-19  Benjamin Kosnik  <bkoz@fillmore.constant.com>
+
+       * configure.in: Don't turn on long long by default.
+       * configure: Regenerate.
+       * include/c/bits/std_cstdio.h: Remove c++config.h include.
+       * src/locale.cc: Formatting tweaks.
+       * testsuite/22_locale/ctype.cc (char<unsigned char>): Provide
+       member functions.
+
+2000-12-19  Loren J. Rittle  <ljrittle@acm.org>
+
+        * testsuite/22_locale/ctype.cc (test01): Correct ~ operator usage.
+
 2000-12-19  Mark Kettenis  <kettenis@gnu.org>
 
         * configure.target: Support the Hurd.
index 9139051bc0fb7ce3950ec6fc35fd185773571667..4dd963cfc5a97575254a199d774ed6fbb36dd763 100755 (executable)
@@ -41,7 +41,7 @@ ac_help="$ac_help
 ac_help="$ac_help
   --enable-c-mbchar       enable multibyte (wide) characters [default=yes]"
 ac_help="$ac_help
-  --enable-long-long      turns on 'long long' [default=yes]"
+  --enable-long-long      turns on 'long long' [default=no]"
 ac_help="$ac_help
   --enable-cshadow-headers construct "shadowed" C header files for
                            g++ [default=no]"
@@ -2881,7 +2881,7 @@ if test "${enable_long_long+set}" = set; then
    *)   { echo "configure: error: Unknown argument to enable/disable long long" 1>&2; exit 1; } ;;
    esac
 else
-  enable_long_long=yes
+  enable_long_long=no
 fi
  
   # Allow use of os-dependent settings, so that macros that turn on
index 2e8ee1d60909176794e517ede6919e5cffcf00eb..2823853b8444d6172fa6650a79738df80a953848 100644 (file)
@@ -36,7 +36,7 @@ GLIBCPP_CHECK_COMPILER_VERSION
 GLIBCPP_ENABLE_DEBUG($USE_MAINTAINER_MODE)
 GLIBCPP_ENABLE_CSTDIO
 GLIBCPP_ENABLE_C_MBCHAR([yes])
-GLIBCPP_ENABLE_LONG_LONG([yes])
+GLIBCPP_ENABLE_LONG_LONG([no])
 GLIBCPP_ENABLE_SHADOW([no])
 GLIBCPP_ENABLE_THREADS
 GLIBCPP_ENABLE_ATOMICITY
index cc22d4519d2a4ad8c9d31b6f71f9d97fa68fab7d..62a19aabf2b9d38a803d8a06a9a2da8acba860da 100644 (file)
@@ -36,7 +36,6 @@
 #ifndef _CPP_CSTDIO
 #define _CPP_CSTDIO 1
 
-#include <bits/c++config.h>
 #include <bits/std_cstdarg.h>
 
 #pragma GCC system_header
index 6c72c7f21b797d3e530718ba3cfe71f0073f0050..29dcc378f7643b10c793c5e928563ef94a46a10a 100644 (file)
@@ -950,8 +950,7 @@ namespace std {
     return __ret;
   };
   
-  ctype<wchar_t>::
-  ~ctype() { }
+  ctype<wchar_t>::~ctype() { }
 
   // NB: These ctype<wchar_t> methods are not configuration-specific,
   // unlike the ctype<char> bits.
index 4e9c9fe05dd2941a2532a3a5061b8d97abd49c3c..b51ee70932bcae185dd76ac6e414cd6219671fef 100644 (file)
@@ -27,7 +27,109 @@ int mask ();
 #include <locale>
 
 // 2: Should be able to instantiate this for other types besides char, wchar_t
-class gnu_ctype: public std::ctype<unsigned char> { };
+typedef std::ctype<char> cctype;
+
+class gnu_ctype: public std::ctype<unsigned char> 
+{ 
+private:
+  const cctype& _M_cctype;
+
+public:
+  explicit 
+  gnu_ctype(size_t __refs = 0) 
+  : std::ctype<unsigned char>(__refs), 
+    _M_cctype(std::use_facet<cctype>(std::locale::classic())) 
+  { }
+
+  ~gnu_ctype();
+
+protected:
+  virtual bool 
+  do_is(mask __m, char_type __c) const
+  { return _M_cctype.is(__m, __c); }
+
+  virtual const char_type*
+  do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const
+  { 
+    const char* __c = _M_cctype.is(reinterpret_cast<const char*>(__lo), 
+                                  reinterpret_cast<const char*>(__hi), __vec);
+    return reinterpret_cast<const char_type*>(__c);
+  }
+  
+  virtual const char_type*
+  do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const
+  {
+    const char* __c = _M_cctype.scan_is(__m, 
+                                       reinterpret_cast<const char*>(__lo), 
+                                       reinterpret_cast<const char*>(__hi));
+    return reinterpret_cast<const char_type*>(__c);
+  }
+
+  virtual const char_type*
+  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
+  {
+    const char* __c = _M_cctype.scan_is(__m, 
+                                       reinterpret_cast<const char*>(__lo), 
+                                       reinterpret_cast<const char*>(__hi));
+    return reinterpret_cast<const char_type*>(__c);
+  }
+
+  virtual char_type 
+  do_toupper(char_type __c) const
+  { return _M_cctype.toupper(__c); }
+
+  virtual const char_type*
+  do_toupper(char_type* __lo, const char_type* __hi) const
+  {
+    const char* __c = _M_cctype.toupper(reinterpret_cast<char*>(__lo), 
+                                       reinterpret_cast<const char*>(__hi));
+    return reinterpret_cast<const char_type*>(__c);
+  }
+
+  virtual char_type 
+  do_tolower(char_type __c) const
+  { return _M_cctype.tolower(__c); }
+
+  virtual const char_type*
+  do_tolower(char_type* __lo, const char_type* __hi) const
+  {
+    const char* __c = _M_cctype.toupper(reinterpret_cast<char*>(__lo), 
+                                       reinterpret_cast<const char*>(__hi));
+    return reinterpret_cast<const char_type*>(__c);
+  }
+
+  virtual char_type 
+  do_widen(char __c) const
+  { return _M_cctype.widen(__c); }
+
+  virtual const char*
+  do_widen(const char* __lo, const char* __hi, char_type* __dest) const
+  {
+    const char* __c = _M_cctype.widen(reinterpret_cast<const char*>(__lo), 
+                                     reinterpret_cast<const char*>(__hi),
+                                     reinterpret_cast<char*>(__dest));
+    return __c;
+  }
+
+  virtual char 
+  do_narrow(char_type __c, char __dfault) const
+  { return _M_cctype.narrow(__c, __dfault); }
+
+  virtual const char_type*
+  do_narrow(const char_type* __lo, const char_type* __hi, char __dfault, 
+           char* __dest) const
+  {
+    const char* __c = _M_cctype.narrow(reinterpret_cast<const char*>(__lo), 
+                                      reinterpret_cast<const char*>(__hi),
+                                      __dfault,
+                                      reinterpret_cast<char*>(__dest));
+    return reinterpret_cast<const char_type*>(__c);
+  }
+
+};
+
+gnu_ctype::~gnu_ctype() { }
+
 gnu_ctype facet01;
 
 // 3: Sanity check ctype_base::mask bitmask requirements
@@ -45,7 +147,7 @@ test01()
   m01 & m02;
   m01 | m02;
   m01 ^ m02;
-  m01 ~ m02;
+  ~m01;
   m01 &= m02;
   m01 |= m02;
   m01 ^= m02;