4 * Copyright 1998-2001 The OpenLDAP Foundation, Redwood City, California, USA
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted only as authorized by the OpenLDAP
9 * Public License. A copy of this license is available at
10 * http://www.OpenLDAP.org/license.html or in file LICENSE in the
11 * top-level directory of the distribution.
17 /* cross compilers should define both AC_INT{2,4}_TYPE in CPPFLAGS */
19 #if !defined( AC_INT4_TYPE )
20 /* use autoconf defines to provide sized typedefs */
22 # define AC_INT4_TYPE long
23 # elif SIZEOF_INT == 4
24 # define AC_INT4_TYPE int
25 # elif SIZEOF_SHORT == 4
26 # define AC_INT4_TYPE short
28 /* used by SHA-1, but commented out */
29 /* # error "AC_INT2_TYPE?" */
33 typedef AC_INT4_TYPE ac_int4;
34 typedef signed AC_INT4_TYPE ac_sint4;
35 typedef unsigned AC_INT4_TYPE ac_uint4;
37 #if !defined( AC_INT2_TYPE )
38 # if SIZEOF_SHORT == 2
39 # define AC_INT2_TYPE short
40 # elif SIZEOF_INT == 2
41 # define AC_INT2_TYPE int
42 # elif SIZEOF_LONG == 2
43 # define AC_INT2_TYPE long
45 /* not used, no error */
46 /* # error "AC_INT2_TYPE?" */
50 #if defined( AC_INT2_TYPE )
51 typedef AC_INT2_TYPE ac_int2;
52 typedef signed AC_INT2_TYPE ac_sint2;
53 typedef unsigned AC_INT2_TYPE ac_uint2;
57 /* cross compilers should define BYTE_ORDER in CPPFLAGS */
60 * Definitions for byte order, according to byte significance from low
63 #define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
64 #define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
65 #define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
67 /* assume autoconf's AC_C_BIGENDIAN has been ran */
68 /* if it hasn't, we assume (maybe falsely) the order is LITTLE ENDIAN */
69 # ifdef WORDS_BIGENDIAN
70 # define BYTE_ORDER BIG_ENDIAN
72 # define BYTE_ORDER LITTLE_ENDIAN
75 #endif /* BYTE_ORDER */
77 #endif /* _AC_BYTES_H */