AC_C_BIGENDIAN([AC_DEFINE(CPU_BIG_ENDIAN)], [AC_DEFINE(CPU_LITTLE_ENDIAN)],
[AC_MSG_ERROR([Cannot determine CPU endianity.])])
+AC_CHECK_SIZEOF(unsigned int)
+AC_CHECK_SIZEOF(unsigned long)
+AC_CHECK_SIZEOF(unsigned long long)
+
BIRD_CHECK_INTEGERS
BIRD_CHECK_STRUCT_ALIGN
BIRD_CHECK_TIME_T
#include "lib/sha512.h"
#include "lib/unaligned.h"
-#define U64_C(c) (c ## UL) /* Maybe is system dependent */
+#if SIZEOF_UNSIGNED_INT == 8
+ #define U64_C(c) (c ## U)
+#elif SIZEOF_UNSIGNED_LONG == 8
+ #define U64_C(c) (c ## UL)
+#elif SIZEOF_UNSIGNED_LONG_LONG == 8
+ #define U64_C(c) (c ## ULL)
+#endif
static uint sha512_transform(void *context, const byte *data, size_t nblks);
/* We have stdint.h */
#undef HAVE_STDINT_H
+/* The size of `unsigned int', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_INT
+
+/* The size of `unsigned long', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_LONG
+
+/* The size of `unsigned long long', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_LONG_LONG
+
#define CONFIG_PATH ?
/* Include OS configuration file as chosen in autoconf.h */
#include SYSCONF_INCLUDE
+/* The AC_CHECK_SIZEOF() in configure fails for some machines.
+ * we provide some fallback values here */
+#ifndef SIZEOF_UNSIGNED_INT
+# define SIZEOF_UNSIGNED_INT 4
+#endif
+#ifndef SIZEOF_UNSIGNED_LONG
+# define SIZEOF_UNSIGNED_LONG 4
+#endif
+#ifndef SIZEOF_UNSIGNED_LONG_LONG
+# define SIZEOF_UNSIGNED_LONG_LONG 8
+#endif
+
#ifndef MACROS_ONLY
/*