Expunge revision histories in files.
[mLib] / bits.h
diff --git a/bits.h b/bits.h
index 5ce1d95..175e927 100644 (file)
--- a/bits.h
+++ b/bits.h
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: bits.h,v 1.7 2000/07/22 09:48:26 mdw Exp $
+ * $Id: bits.h,v 1.10 2004/04/08 01:36:11 mdw Exp $
  *
  * Portable bit-level manipulation macros
  *
  * MA 02111-1307, USA.
  */
 
-/*----- Revision history --------------------------------------------------* 
- *
- * $Log: bits.h,v $
- * Revision 1.7  2000/07/22 09:48:26  mdw
- * Added macros for reading 64-bit values.
- *
- * Revision 1.6  2000/07/16 12:28:28  mdw
- * Add 64-bit support, with faked arithmetic on 32-bit hosts.
- *
- * Revision 1.5  2000/06/17 10:36:06  mdw
- * Support for 24-bit types.
- *
- * Revision 1.4  1999/12/10 23:42:04  mdw
- * Change header file guard names.
- *
- * Revision 1.3  1999/06/20 23:31:52  mdw
- * More portability enhancements.
- *
- * Revision 1.2  1999/06/17 00:12:46  mdw
- * Improve portability for shift and rotate macros.
- *
- * Revision 1.1  1999/06/01 09:46:19  mdw
- * New addition: bit manipulation macros.
- *
- */
-
 #ifndef MLIB_BITS_H
 #define MLIB_BITS_H
 
 
 /*----- Decide on some types ----------------------------------------------*/
 
+/* --- Make GNU C shut up --- */
+
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 91)
+#  define MLIB_BITS_EXTENSION __extension__
+#else
+#  define MLIB_BITS_EXTENSION
+#endif
+
 /* --- Decide on a 32-bit type --- *
  *
  * I want a type which is capable of expressing 32-bit numbers.  Because some
 #endif
 
 #if UINT_MAX >> 31 > 0xffffffff
-# define HAVE_UINT64
-  typedef unsigned int uint64;
+#  define HAVE_UINT64
+   typedef unsigned int uint64;
 #elif ULONG_MAX >> 31 > 0xffffffff
-# define HAVE_UINT64
-  typedef unsigned long uint64;
+#  define HAVE_UINT64
+   typedef unsigned long uint64;
 #elif defined(ULLONG_MAX)
-# define HAVE_UINT64
-  typedef unsigned long long uint64;
+#  define HAVE_UINT64
+   MLIB_BITS_EXTENSION typedef unsigned long long uint64;
 #endif
 
 #ifdef DEBUG64
@@ -148,7 +130,7 @@ typedef unsigned char octet;
 #define MASK32 0xffffffffu
 
 #ifdef HAVE_UINT64
-#  define MASK64 0xffffffffffffffffull
+#  define MASK64 MLIB_BITS_EXTENSION 0xffffffffffffffffu
 #endif
 
 /* --- Type coercions --- */
@@ -445,6 +427,14 @@ typedef unsigned char octet;
 #  define ZERO64(x) ((x).lo == 0 && (x).hi == 0)
 #endif
 
+/* --- Storing integers in tables --- */
+
+#ifdef HAVE_UINT64
+#  define X64(x, y) { 0x##x##y }
+#else
+#  define X64(x, y) { 0x##x, 0x##y }
+#endif
+    
 /*----- That's all, folks -------------------------------------------------*/
 
 #ifdef __cplusplus