3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 1998-2017 The OpenLDAP Foundation.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted only as authorized by the OpenLDAP
12 * A copy of this license is available in file LICENSE in the
13 * top-level directory of the distribution or, alternatively, at
14 * <http://www.OpenLDAP.org/license.html>.
20 /* cross compilers should define both AC_INT{2,4}_TYPE in CPPFLAGS */
22 #if !defined( AC_INT4_TYPE )
23 /* use autoconf defines to provide sized typedefs */
25 # define AC_INT4_TYPE long
26 # elif SIZEOF_INT == 4
27 # define AC_INT4_TYPE int
28 # elif SIZEOF_SHORT == 4
29 # define AC_INT4_TYPE short
31 # error "AC_INT4_TYPE?"
35 typedef AC_INT4_TYPE ac_int4;
36 typedef signed AC_INT4_TYPE ac_sint4;
37 typedef unsigned AC_INT4_TYPE ac_uint4;
39 #if !defined( AC_INT2_TYPE )
40 # if SIZEOF_SHORT == 2
41 # define AC_INT2_TYPE short
42 # elif SIZEOF_INT == 2
43 # define AC_INT2_TYPE int
44 # elif SIZEOF_LONG == 2
45 # define AC_INT2_TYPE long
47 # error "AC_INT2_TYPE?"
51 #if defined( AC_INT2_TYPE )
52 typedef AC_INT2_TYPE ac_int2;
53 typedef signed AC_INT2_TYPE ac_sint2;
54 typedef unsigned AC_INT2_TYPE ac_uint2;
58 /* cross compilers should define BYTE_ORDER in CPPFLAGS */
61 * Definitions for byte order, according to byte significance from low
64 #define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
65 #define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
66 #define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
68 /* assume autoconf's AC_C_BIGENDIAN has been ran */
69 /* if it hasn't, we assume (maybe falsely) the order is LITTLE ENDIAN */
70 # ifdef WORDS_BIGENDIAN
71 # define BYTE_ORDER BIG_ENDIAN
73 # define BYTE_ORDER LITTLE_ENDIAN
76 #endif /* BYTE_ORDER */
78 #endif /* _AC_BYTES_H */