#! /bin/sh /usr/share/dpatch/dpatch-run
## 18-fix-bswap-detection.dpatch by Thomas Girard <thomas.g.girard@free.fr>
##
## DP: taken from upstream: fix bswap autoconf detection
@DPATCH@
--- ACE_wrappers.orig/configure.ac
+++ ACE_wrappers/configure.ac
@@ -3445,15 +3445,24 @@
 
 ACE_CHECK_HAS_DEFINES([bswap16])
 if test "$ace_cv_defined_bswap16" = no; then
-  ACE_CHECK_HAS_DEFINES([bswap_16])
+  ACE_CHECK_HAS_DEFINES([bswap_16],[],[],[
+#if ACE_HAS_BYTESWAP_H
+#include <byteswap.h>
+#endif])
 fi
 ACE_CHECK_HAS_DEFINES([bswap32])
 if test "$ace_cv_defined_bswap32" = no; then
-  ACE_CHECK_HAS_DEFINES([bswap_32])
+  ACE_CHECK_HAS_DEFINES([bswap_32],[],[],[
+#if ACE_HAS_BYTESWAP_H
+#include <byteswap.h>
+#endif])
 fi
 ACE_CHECK_HAS_DEFINES([bswap64])
 if test "$ace_cv_defined_bswap64" = no; then
-  ACE_CHECK_HAS_DEFINES([bswap_64])
+  ACE_CHECK_HAS_DEFINES([bswap_64],[],[],[
+#if ACE_HAS_BYTESWAP_H
+#include <byteswap.h>
+#endif])
 fi
 
 ACE_CHECK_LACKS_FUNCS(chdir)
