Hi.

I'm building blackbox from CVS with the latest GCC from CVS. The
compiler currently doesn't like the use of std::bit_vector in the code,
though I carelessly have deleted the error message returned when trying
to compile the code. It was something about a declaration in class
scope, or something close ...

After poking around the libstdc++ documentation, I found that the
bit_vector class was a class that used before specialization of the
vector<bool> class was available, and is now kept for backwards
compatibility. Figuring that many/most people now building blackbox have
recent C++ compilers that should handle the vector<bool> stuff without
problems, I replaced the bit_vector stuff with the newer vector<bool>
things and rebuilt. The replaced code compiled without problems in
GCC-3.3, and my GCC build from a day ago was happy too.

The build with the CVS GCC still ultimately fails with the following
error compiling both Toolbar.cc and Window.cc:

/home/arth/gnu/blackbox/lib/Util.hh: In copy constructor
`bt::Pen::Pen(const bt::Pen&)':
/home/arth/gnu/blackbox/lib/Util.hh:55: error: `bt::NoCopy::NoCopy(const
bt::NoCopy&)' is private
/home/arth/gnu/blackbox/src/Toolbar.cc:493: error: within this context
make[2]: *** [Toolbar.o] Error 1

I'm going to try and see what can be done with getting this resolved.
GCC-3.3 doesn't have a problem with the file, so this _might_ be a
glitch in my bleeding-edge GCC, or it could be a real code issue that
the old GCC wasn't smart enough to detect.

Enough babbling, here's the bit_vector -> vector<bool> patch.

My thanks to everyone working on blackbox.

Art Haas
Index: lib/Menu.hh
===================================================================
RCS file: /cvsroot/blackboxwm/blackbox/lib/Menu.hh,v
retrieving revision 1.19
diff -u -r1.19 Menu.hh
--- lib/Menu.hh 15 Jan 2004 09:44:08 -0000      1.19
+++ lib/Menu.hh 1 Feb 2004 14:21:07 -0000
@@ -263,7 +263,7 @@
     std::string _title;
 
     ItemList _items;
-    std::bit_vector _id_bits;
+    std::vector<bool> _id_bits;
 
     Menu *_parent_menu;
     Menu *_active_submenu;
Index: lib/Menu.cc
===================================================================
RCS file: /cvsroot/blackboxwm/blackbox/lib/Menu.cc,v
retrieving revision 1.45
diff -u -r1.45 Menu.cc
--- lib/Menu.cc 15 Jan 2004 09:44:08 -0000      1.45
+++ lib/Menu.cc 1 Feb 2004 14:21:10 -0000
@@ -1096,7 +1096,7 @@
     abort();
   }
 
-  std::bit_vector::iterator it =
+  std::vector<bool>::iterator it =
     std::find(_id_bits.begin(), _id_bits.end(), false);
   if (it == _id_bits.end()) {
     // no free bits... expand
Index: src/Screen.cc
===================================================================
RCS file: /cvsroot/blackboxwm/blackbox/src/Screen.cc,v
retrieving revision 1.230
diff -u -r1.230 Screen.cc
--- src/Screen.cc       26 Jan 2004 15:11:54 -0000      1.230
+++ src/Screen.cc       1 Feb 2004 14:21:16 -0000
@@ -1839,7 +1839,7 @@
   // build a distribution grid
   unsigned int gw = x_end - x_begin - 1,
                gh = y_end - y_begin - 1;
-  std::bit_vector used_grid(gw * gh);
+  std::vector<bool> used_grid(gw * gh);
   std::fill_n(used_grid.begin(), used_grid.size(), false);
 
   for (w_it = stackingList.begin(), w_end = stackingList.end();
-- 
Man once surrendering his reason, has no remaining guard against absurdities
the most monstrous, and like a ship without rudder, is the sport of every wind.

-Thomas Jefferson to James Smith, 1822

-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
List archives:  http://asgardsrealm.net/lurker/splash/index.html
Trouble? Contact [EMAIL PROTECTED]

Reply via email to