Hello.  I'm using the libcdio library for command line access to data
inside a ISO file.  I've run in to a couple of bugs though in the CVS
version downloaded a couple of days ago.

The code included when stdbool.h is not found is broken.  It #define's a
bool to be an enum which, under gcc 3, is four bytes long.  This totally
screws up the parsing of directory entries which presumably do something
like ndx +=3D sizeof(bool) somewhere.  Here's a patch:

Also, I'm not convinced that having types.h depend on autoconf variables
is such a good idea.  As an external user of the library (i.e only files
installed in /usr/local/lib and /usr/local/include) all the
"workarounds" are activated since I didn't add the various HAVE_FOO_H
defines to my command line.  This is how I discovered the bool/enum
problem.


Regards,

Tim.

Index: include/cdio/types.h
===================================================================
RCS file: /cvsroot/libcdio/libcdio/include/cdio/types.h,v
retrieving revision 1.28
diff -u -r1.28 types.h
--- include/cdio/types.h	1 Mar 2005 09:33:52 -0000	1.28
+++ include/cdio/types.h	17 Mar 2005 00:32:12 -0000
@@ -102,15 +102,9 @@
   /* ISO/IEC 9899:1999 <stdbool.h> missing -- enabling workaround */
   
 # ifndef __cplusplus
-  typedef enum
-    {
-      false = 0,
-      true = 1
-    } _cdio_Bool;
-  
-#  define false   false
-#  define true    true
-#  define bool _cdio_Bool
+#  define false   0
+#  define true    1
+#  define bool uint8_t
 # endif
 #endif
   
_______________________________________________
Libcdio-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/libcdio-devel

Reply via email to