4 * Copyright 1998-2000 The OpenLDAP Foundation, Redwood City, California, USA
7 * Redistribution and use in source and binary forms are permitted only
8 * as authorized by the OpenLDAP Public License. A copy of this
9 * license is available at http://www.OpenLDAP.org/license.html or
10 * in file LICENSE in the top-level directory of the distribution.
16 /* cross compilers should define both AC_INT{2,4}_TYPE in CPPFLAGS */
18 #if !defined( AC_INT4_TYPE )
19 /* use autoconf defines to provide sized typedefs */
21 # define AC_INT4_TYPE long
22 # elif SIZEOF_INT == 4
23 # define AC_INT4_TYPE int
24 # elif SIZEOF_SHORT == 4
25 # define AC_INT4_TYPE short
27 # error "AC_INT4_TYPE?"
31 typedef AC_INT4_TYPE ac_int4;
32 typedef signed AC_INT4_TYPE ac_sint4;
33 typedef unsigned AC_INT4_TYPE ac_uint4;
35 #if !defined( AC_INT2_TYPE )
36 # if SIZEOF_SHORT == 2
37 # define AC_INT2_TYPE short
38 # elif SIZEOF_INT == 2
39 # define AC_INT2_TYPE int
40 # elif SIZEOF_LONG == 2
41 # define AC_INT2_TYPE long
43 /* not used, no error */
44 /* # error "AC_INT2_TYPE?" */
48 #if defined( AC_INT2_TYPE )
49 typedef AC_INT2_TYPE ac_int2;
50 typedef signed AC_INT2_TYPE ac_sint2;
51 typedef unsigned AC_INT2_TYPE ac_uint2;
55 /* cross compilers should define BYTE_ORDER in CPPFLAGS */
58 * Definitions for byte order, according to byte significance from low
61 #define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
62 #define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
63 #define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
65 /* assume autoconf's AC_C_BIGENDIAN has been ran */
66 /* if it hasn't, we assume (maybe falsely) the order is LITTLE ENDIAN */
67 # ifdef WORDS_BIGENDIAN
68 # define BYTE_ORDER BIG_ENDIAN
70 # define BYTE_ORDER LITTLE_ENDIAN
73 #endif /* BYTE_ORDER */
75 #endif /* _AC_BYTES_H */