forked from Mirror/frr
lib: Fix compilation of some be32* code
The be32dec and be32enc functions are available on some platforms and not others. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
4f13df624b
commit
ba0cb3fe96
|
@ -1602,6 +1602,12 @@ AC_TRY_COMPILE([#include <netinet/in.h>], [
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
])
|
])
|
||||||
|
|
||||||
|
dnl --------------------------------------
|
||||||
|
dnl checking for be32dec existence or not
|
||||||
|
dnl --------------------------------------
|
||||||
|
AC_CHECK_DECLS([be32enc, be32dec], [], [],
|
||||||
|
[#include <sys/endian.h>])
|
||||||
|
|
||||||
dnl --------------------------------------
|
dnl --------------------------------------
|
||||||
dnl checking for clock_time monotonic struct and call
|
dnl checking for clock_time monotonic struct and call
|
||||||
dnl --------------------------------------
|
dnl --------------------------------------
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#include <zebra.h>
|
#include <zebra.h>
|
||||||
#include "sha256.h"
|
#include "sha256.h"
|
||||||
|
|
||||||
#ifdef GNU_LINUX
|
#if !HAVE_DECL_BE32DEC
|
||||||
static inline uint32_t
|
static inline uint32_t
|
||||||
be32dec(const void *pp)
|
be32dec(const void *pp)
|
||||||
{
|
{
|
||||||
|
@ -36,7 +36,9 @@ be32dec(const void *pp)
|
||||||
return ((uint32_t)(p[3]) + ((uint32_t)(p[2]) << 8) +
|
return ((uint32_t)(p[3]) + ((uint32_t)(p[2]) << 8) +
|
||||||
((uint32_t)(p[1]) << 16) + ((uint32_t)(p[0]) << 24));
|
((uint32_t)(p[1]) << 16) + ((uint32_t)(p[0]) << 24));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !HAVE_DECL_BE32ENC
|
||||||
static inline void
|
static inline void
|
||||||
be32enc(void *pp, uint32_t x)
|
be32enc(void *pp, uint32_t x)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue