summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2012-05-01 16:30:42 -0400
committerStephen Gallagher <sgallagh@redhat.com>2012-05-02 08:11:23 -0400
commite9597202540eca119b9a292cd5430de33fb793c1 (patch)
treec787085db56b3d468d136353f0c875f791ffd322 /src/util
parent8a90e3ce2d2e47ea8c031493e9aaaf551aaa30ad (diff)
downloadsssd-e9597202540eca119b9a292cd5430de33fb793c1.tar.gz
sssd-e9597202540eca119b9a292cd5430de33fb793c1.tar.xz
sssd-e9597202540eca119b9a292cd5430de33fb793c1.zip
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.
Diffstat (limited to 'src/util')
-rw-r--r--src/util/util.h17
1 files changed, 17 insertions, 0 deletions
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 <byteswap.h>
+
+/* 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__ */