RHEL 5: inspect: Add macro for be32toh if one is not defined in the header files.

This commit is contained in:
Richard W.M. Jones
2013-03-08 20:16:04 +00:00
parent 74297e6109
commit bb0617859f
2 changed files with 13 additions and 0 deletions

View File

@@ -279,6 +279,7 @@ AC_CHECK_HEADERS([\
dnl Functions.
AC_CHECK_FUNCS([\
be32toh \
fsync \
futimens \
getxattr \

View File

@@ -32,6 +32,18 @@
#include <endian.h>
#endif
/* be32toh is usually a macro definend in <endian.h>, but it might be
* a function in some system so check both, and if neither is defined
* then define be32toh for RHEL 5.
*/
#if !defined(HAVE_BE32TOH) && !defined(be32toh)
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define be32toh(x) __bswap_32 (x)
#else
#define be32toh(x) (x)
#endif
#endif
#include <pcre.h>
#include "xstrtol.h"