summaryrefslogtreecommitdiffstats
path: root/common/arch.h
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2014-08-12 20:01:33 -0700
committerJay Sorg <jay.sorg@gmail.com>2014-08-12 20:01:33 -0700
commit75874b3f7aebf481e08e25a35a99a23cf0985ec2 (patch)
tree0253d12f545d4d980cc92f366a8a3da272af6f97 /common/arch.h
parent23b2822cfbcbf370bf506a0e30104c95f5487815 (diff)
downloadxrdp-proprietary-75874b3f7aebf481e08e25a35a99a23cf0985ec2.tar.gz
xrdp-proprietary-75874b3f7aebf481e08e25a35a99a23cf0985ec2.zip
common: some minor changes to arch.h
Diffstat (limited to 'common/arch.h')
-rw-r--r--common/arch.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/common/arch.h b/common/arch.h
index f928e590..14ab9d7d 100644
--- a/common/arch.h
+++ b/common/arch.h
@@ -19,17 +19,35 @@
#if !defined(ARCH_H)
#define ARCH_H
+/* 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))
-/* check endianess */
#if defined(__sparc__) || defined(__PPC__) || defined(__ppc__) || \
- defined(__hppa__) || (BYTE_ORDER == BIG_ENDIAN)
+ 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__)