]> git.sur5r.net Git - openldap/blobdiff - include/ac/bytes.h
Merge latest devel codes into releng 2 branch.
[openldap] / include / ac / bytes.h
index 160f0bbc8e1b729a509909690465f8f31dc8a5ab..712ed8b9297271e988e5d0524379db560fd6a450 100644 (file)
@@ -1,7 +1,7 @@
 /* Generic bytes.h */
 /* $OpenLDAP$ */
 /*
- * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
+ * Copyright 1998-2000 The OpenLDAP Foundation, Redwood City, California, USA
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms are permitted only
 
 /* cross compilers should define both AC_INT{2,4}_TYPE in CPPFLAGS */
 
-#if !defined( AC_INT4_TYPE ) || !defined( AC_INT2_TYPE )
+#if !defined( AC_INT4_TYPE ) 
        /* use autoconf defines to provide sized typedefs */
 #      if SIZEOF_LONG == 4
 #              define AC_INT4_TYPE long
 #      elif SIZEOF_INT == 4
 #              define AC_INT4_TYPE int
+#      elif SIZEOF_SHORT == 4
+#              define AC_INT4_TYPE short
 #      else
 #              error "AC_INT4_TYPE?"
 #      endif
+#endif
+
+typedef AC_INT4_TYPE ac_int4;
+typedef signed AC_INT4_TYPE ac_sint4;
+typedef unsigned AC_INT4_TYPE ac_uint4;
 
+#if !defined( AC_INT2_TYPE ) 
 #      if SIZEOF_SHORT == 2
 #              define AC_INT2_TYPE short
 #      elif SIZEOF_INT == 2
 #              define AC_INT2_TYPE int
+#      elif SIZEOF_LONG == 2
+#              define AC_INT2_TYPE long
 #      else
-#              error "AC_INT2_TYPE?"
+/* not used, no error */
+/* #   error "AC_INT2_TYPE?" */
 #      endif
 #endif
     
-typedef AC_INT4_TYPE ac_int4;
-typedef signed AC_INT4_TYPE ac_sint4;
-typedef unsigned AC_INT4_TYPE ac_uint4;
-
+#if defined( AC_INT2_TYPE ) 
 typedef AC_INT2_TYPE ac_int2;
 typedef signed AC_INT2_TYPE ac_sint2;
 typedef unsigned AC_INT2_TYPE ac_uint2;
+#endif
 
 #ifndef BYTE_ORDER
 /* cross compilers should define BYTE_ORDER in CPPFLAGS */