/* Generic bytes.h */
+/*
+ * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
+ * 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.
+ */
#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 */
+ /* cross compilers should define LDAP_INT{2,4}_TYPE in CPPFLAGS */
typedef LDAP_INT4_TYPE LDAP_INT4;
typedef signed LDAP_INT4_TYPE LDAP_SINT4;
typedef unsigned LDAP_INT4_TYPE LDAP_UINT4;
typedef signed int LDAP_SINT4;
typedef unsigned int LDAP_UINT4;
+# elif SIZEOF_SHORT == 4
+ typedef short LDAP_INT4;
+ typedef signed short LDAP_SINT4;
+ typedef unsigned short LDAP_UINT4;
+
+# else
+# error "No 4 byte integer type!"
# endif
# if SIZEOF_SHORT == 2
typedef short LDAP_INT2;
typedef signed short LDAP_SINT2;
typedef unsigned short LDAP_UINT2;
+
# elif SIZEOF_INT == 2
typedef int LDAP_INT2;
typedef signed int LDAP_SINT2;
typedef unsigned int LDAP_UINT2;
+
+# elif SIZEOF_LONG == 2
+ typedef long LDAP_INT2;
+ typedef signed long LDAP_SINT2;
+ typedef unsigned long LDAP_UINT2;
+
+# else
+/* not in use, no error */
+/* # error "No 2 byte integer type!" */
# endif
#endif