From e9597202540eca119b9a292cd5430de33fb793c1 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Tue, 1 May 2012 16:30:42 -0400 Subject: Handle endianness issues on older systems Older versions of glibc (like that on RHEL 5) do not have the le32toh() function exposed. We need this for handling the Active Directory ID-mapping, so we'll copy these macros from endian.h on a newer glibc. --- src/util/util.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/util') diff --git a/src/util/util.h b/src/util/util.h index 370729018..bfa054648 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -536,4 +536,21 @@ struct sss_domain_info *new_subdomain(TALLOC_CTX *mem_ctx, struct sss_domain_info *copy_subdomain(TALLOC_CTX *mem_ctx, struct sss_domain_info *subdomain); +/* Endianness-compatibility for systems running older versions of glibc */ + +#ifndef le32toh +#include + +/* Copied from endian.h on glibc 2.15 */ +#ifdef __USE_BSD +/* Conversion interfaces. */ +# if __BYTE_ORDER == __LITTLE_ENDIAN +# define le32toh(x) (x) +# else +# define le32toh(x) __bswap_32 (x) +# endif +#endif /* __USE_BSD */ + +#endif /* le32toh */ + #endif /* __SSSD_UTIL_H__ */ -- cgit