File xrdp-some-minor-changes-to-arch.h.patch of Package xrdp

Index: xrdp-0.6.1/common/arch.h
===================================================================
--- xrdp-0.6.1.orig/common/arch.h
+++ xrdp-0.6.1/common/arch.h
@@ -24,19 +24,45 @@
 #if !defined(ARCH_H)
 #define ARCH_H
 
-#if !(defined(L_ENDIAN) || defined(B_ENDIAN))
+/* you can define L_ENDIAN or B_ENDIAN and NEED_ALIGN or NO_NEED_ALIGN
+   in the makefile to override */
+
 /* check endianess */
+#if !(defined(L_ENDIAN) || defined(B_ENDIAN))
+#if !defined(__BYTE_ORDER) && defined(__linux__)
+#include <endian.h>
+#endif
+
+#if defined(BYTE_ORDER)
+#if BYTE_ORDER == BIG_ENDIAN
+#define B_ENDIAN
+#else
+#define L_ENDIAN
+#endif
+#endif
+
+#if !(defined(L_ENDIAN) || defined(B_ENDIAN))
 #if defined(__sparc__) || defined(__PPC__) || defined(__ppc__) || \
     defined(__hppa__)
 #define B_ENDIAN
 #else
 #define L_ENDIAN
 #endif
+#endif
+#endif
+
 /* check if we need to align data */
+#if !(defined(NEED_ALIGN) || defined(NO_NEED_ALIGN))
 #if defined(__sparc__) || defined(__alpha__) || defined(__hppa__) || \
     defined(__AIX__) || defined(__PPC__) || defined(__mips__) || \
     defined(__ia64__) || defined(__ppc__) || defined(__arm__)
 #define NEED_ALIGN
+#elif defined(__x86__) || defined(__x86_64__) || \
+      defined(__AMD64__) || defined(_M_IX86) || defined (_M_AMD64) || \
+      defined(__i386__)
+#define NO_NEED_ALIGN
+#else
+#warning unknown arch
 #endif
 #endif
openSUSE Build Service is sponsored by