]> git.sur5r.net Git - openldap/blobdiff - include/ac/bytes.h
Misc Windows linking fixes
[openldap] / include / ac / bytes.h
index 74265604a3b68670125c97fe0a3d9540b692286b..a2408f96cd97b36c7473b59d6bf35ac97fba6e9b 100644 (file)
@@ -1,51 +1,59 @@
 /* Generic bytes.h */
-/*
- * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 1998-2005 The OpenLDAP Foundation.
  * All rights reserved.
  *
- * Redistribution and use in source and binary forms are permitted only
- * as authorized by the OpenLDAP Public License.  A copy of this
- * license is available at http://www.OpenLDAP.org/license.html or
- * in file LICENSE in the top-level directory of the distribution.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
  */
 
 #ifndef _AC_BYTES_H
 #define _AC_BYTES_H
 
-#if defined( LDAP_INT4_TYPE ) && defined( LDAP_INT2_TYPE )
-       /* cross compilers should define LDAP_INT{2,4}_TYPE in CPPFLAS */
-       typedef LDAP_INT4_TYPE LDAP_INT4;
-       typedef signed LDAP_INT4_TYPE LDAP_SINT4;
-       typedef unsigned LDAP_INT4_TYPE LDAP_UINT4;
+/* cross compilers should define both AC_INT{2,4}_TYPE in CPPFLAGS */
 
-       typedef LDAP_INT2_TYPE LDAP_INT2;
-       typedef signed LDAP_INT2_TYPE LDAP_SINT2;
-       typedef unsigned LDAP_INT2_TYPE LDAP_UINT2;
-
-#else
+#if !defined( AC_INT4_TYPE )
        /* use autoconf defines to provide sized typedefs */
 #      if SIZEOF_LONG == 4
-               typedef long LDAP_INT4;
-               typedef signed long LDAP_SINT4;
-               typedef unsigned long LDAP_UINT4;
+#              define AC_INT4_TYPE long
 #      elif SIZEOF_INT == 4
-               typedef int LDAP_INT4;
-               typedef signed int LDAP_SINT4;
-               typedef unsigned int LDAP_UINT4;
-
+#              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
-               typedef short LDAP_INT2;
-               typedef signed short LDAP_SINT2;
-               typedef unsigned short LDAP_UINT2;
+#              define AC_INT2_TYPE short
 #      elif SIZEOF_INT == 2
-               typedef int LDAP_INT2;
-               typedef signed int LDAP_SINT2;
-               typedef unsigned int LDAP_UINT2;
+#              define AC_INT2_TYPE int
+#      elif SIZEOF_LONG == 2
+#              define AC_INT2_TYPE long
+#      else
+#      error "AC_INT2_TYPE?"
 #      endif
 #endif
-    
+#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 */