Commit 804ee145 authored by Pavel Tvrdík's avatar Pavel Tvrdík
Browse files

Birdtest: U64_C() macro

parent ca996d80
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -247,6 +247,10 @@ AC_TRY_COMPILE([#include <sys/types.h>
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
+7 −1
Original line number Diff line number Diff line
@@ -20,7 +20,13 @@
#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);

+9 −0
Original line number Diff line number Diff line
@@ -66,4 +66,13 @@
/* 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 ?
+12 −0
Original line number Diff line number Diff line
@@ -15,6 +15,18 @@
/* 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

/*