0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-23 10:11:53 +00:00

Birdtest: U64_C() macro

This commit is contained in:
Pavel Tvrdík 2015-08-03 13:46:45 +02:00
parent ca996d807f
commit 804ee1458d
4 changed files with 32 additions and 1 deletions

View File

@ -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_C_BIGENDIAN([AC_DEFINE(CPU_BIG_ENDIAN)], [AC_DEFINE(CPU_LITTLE_ENDIAN)],
[AC_MSG_ERROR([Cannot determine CPU endianity.])]) [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_INTEGERS
BIRD_CHECK_STRUCT_ALIGN BIRD_CHECK_STRUCT_ALIGN
BIRD_CHECK_TIME_T BIRD_CHECK_TIME_T

View File

@ -20,7 +20,13 @@
#include "lib/sha512.h" #include "lib/sha512.h"
#include "lib/unaligned.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); static uint sha512_transform(void *context, const byte *data, size_t nblks);

View File

@ -66,4 +66,13 @@
/* We have stdint.h */ /* We have stdint.h */
#undef 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 ? #define CONFIG_PATH ?

View File

@ -15,6 +15,18 @@
/* Include OS configuration file as chosen in autoconf.h */ /* Include OS configuration file as chosen in autoconf.h */
#include SYSCONF_INCLUDE #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 #ifndef MACROS_ONLY
/* /*