OSDN Git Service

2000-12-13 Benjamin Kosnik <bkoz@redhat.com>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / config / os / generic / bits / ctype_base.h
index 08b8534..58976b6 100644 (file)
   
   struct ctype_base
   {
-    typedef unsigned int       mask;
     // Non-standard typedefs.
     typedef const int*                 __to_type;
 
-    enum
-    {
-      space  = (1 << 0),     // Whitespace
-      print  = (1 << 1),     // Printing
-      cntrl  = (1 << 2),     // Control character
-      upper  = (1 << 3),     // UPPERCASE
-      lower  = (1 << 4),     // lowercase
-      alpha  = (1 << 5),     // Alphabetic
-      digit  = (1 << 6),     // Numeric
-      punct  = (1 << 7),     // Punctuation
-      xdigit = (1 << 8),     // Hexadecimal numeric
-      alnum  = (1 << 9),     // Alphanumeric
-      graph  = (1 << 10)     // Graphical
-    };
+    // NB: Offsets into ctype<char>::_M_table force a particular size
+    // on the mask type. Because of this, we don't use an enum.
+    typedef unsigned int       mask;   
+    static const mask upper            = 1 << 0;
+    static const mask lower    = 1 << 1;
+    static const mask alpha    = 1 << 2;
+    static const mask digit    = 1 << 3;
+    static const mask xdigit   = 1 << 4;
+    static const mask space    = 1 << 5;
+    static const mask print    = 1 << 6;
+    static const mask graph    = 1 << 7;
+    static const mask cntrl    = 1 << 8;
+    static const mask punct    = 1 << 9;
+    static const mask alnum    = 1 << 10;
   };