summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure38
-rw-r--r--configure.in21
-rw-r--r--src/common/atomic.h4
-rw-r--r--src/common/cbasetypes.h12
-rw-r--r--src/common/grfio.c18
-rw-r--r--src/common/mmo.h15
6 files changed, 89 insertions, 19 deletions
diff --git a/configure b/configure
index a0cf9ecad..16bb8a738 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.in 284a163.
+# From configure.in 8801585.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69.
#
@@ -4867,8 +4867,44 @@ if ac_fn_c_try_run "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -march=i686 (and we can run it)" >&5
+$as_echo_n "checking whether $CC supports -march=i686 (and we can run it)... " >&6; }
+ OLD_CFLAGS="$CFLAGS"
+ OLD_LDFLAGS="$LDFLAGS"
CFLAGS="$CFLAGS -march=i686"
LDFLAGS="$LDFLAGS -march=i686"
+ if test "$cross_compiling" = yes; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: guessing no" >&5
+$as_echo "guessing no" >&6; }
+ CFLAGS="$OLD_CFLAGS"
+ LDFLAGS="$OLD_LDFLAGS"
+
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ int main(int argc, char **argv) { return 0; }
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ CFLAGS="$OLD_CFLAGS"
+ LDFLAGS="$OLD_LDFLAGS"
+
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
else
diff --git a/configure.in b/configure.in
index 1fc2d0e29..6755e3ca5 100644
--- a/configure.in
+++ b/configure.in
@@ -481,8 +481,29 @@ AC_RUN_IFELSE(
])],
[
AC_MSG_RESULT([yes])
+ AC_MSG_CHECKING([whether $CC supports -march=i686 (and we can run it)])
+ OLD_CFLAGS="$CFLAGS"
+ OLD_LDFLAGS="$LDFLAGS"
CFLAGS="$CFLAGS -march=i686"
LDFLAGS="$LDFLAGS -march=i686"
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([
+ int main(int argc, char **argv) { return 0; }
+ ])],
+ [
+ AC_MSG_RESULT([yes])
+ ],
+ [
+ AC_MSG_RESULT([no])
+ CFLAGS="$OLD_CFLAGS"
+ LDFLAGS="$OLD_LDFLAGS"
+ ],
+ [
+ AC_MSG_RESULT([guessing no])
+ CFLAGS="$OLD_CFLAGS"
+ LDFLAGS="$OLD_LDFLAGS"
+ ]
+ )
],
[
AC_MSG_RESULT([no])
diff --git a/src/common/atomic.h b/src/common/atomic.h
index c2227a9d4..8c01943e7 100644
--- a/src/common/atomic.h
+++ b/src/common/atomic.h
@@ -87,7 +87,9 @@ forceinline volatile int64 InterlockedExchange64(volatile int64 *target, int64 v
#elif defined(__GNUC__)
-#if !defined(__x86_64__) && !defined(__i386__)
+// The __sync functions are available on x86 or ARMv6+
+#if !defined(__x86_64__) && !defined(__i386__) \
+ && ( !defined(__ARM_ARCH_VERSION__) || __ARM_ARCH_VERSION__ < 6 )
#error Your Target Platfrom is not supported
#endif
diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h
index 654334a9b..f44e80413 100644
--- a/src/common/cbasetypes.h
+++ b/src/common/cbasetypes.h
@@ -42,6 +42,18 @@
#define __DARWIN__
#endif
+// Standardize the ARM platform version, if available (the only values we're interested in right now are >= ARMv6)
+#if defined(__ARMV6__) || defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) \
+ || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) // gcc ARMv6
+#define __ARM_ARCH_VERSION__ 6
+#elif defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7S__) // gcc ARMv7
+#define __ARM_ARCH_VERSION__ 7
+#elif defined(_M_ARM) // MSVC
+#define __ARM_ARCH_VERSION__ _M_ARM
+#else
+#define __ARM_ARCH_VERSION__ 0
+#endif
+
// Necessary for __NetBSD_Version__ (defined as VVRR00PP00) on NetBSD
#ifdef __NETBSD__
#include <sys/param.h>
diff --git a/src/common/grfio.c b/src/common/grfio.c
index 57e8a5187..bde0ed720 100644
--- a/src/common/grfio.c
+++ b/src/common/grfio.c
@@ -21,15 +21,15 @@
// file entry table struct
//----------------------------
typedef struct _FILELIST {
- int srclen; // compressed size
- int srclen_aligned;
- int declen; // original size
- int srcpos; // position of entry in grf
- int next; // index of next filelist entry with same hash (-1: end of entry chain)
- char type;
- char fn[128-4*5]; // file name
- char* fnd; // if the file was cloned, contains name of original file
- char gentry; // read grf file select
+ int srclen; ///< compressed size
+ int srclen_aligned;
+ int declen; ///< original size
+ int srcpos; ///< position of entry in grf
+ int next; ///< index of next filelist entry with same hash (-1: end of entry chain)
+ char type;
+ char fn[128-4*5]; ///< file name
+ char *fnd; ///< if the file was cloned, contains name of original file
+ int8 gentry; ///< read grf file select
} FILELIST;
#define FILELIST_TYPE_FILE 0x01 // entry is a file
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 2b66c516c..cf3933d40 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -334,14 +334,13 @@ struct s_homunculus { //[orn]
unsigned int exp;
short rename_flag;
short vaporize; //albator
- int str ;
- int agi ;
- int vit ;
- int int_ ;
- int dex ;
- int luk ;
-
- char spiritball; //for homun S [lighta]
+ int str;
+ int agi;
+ int vit;
+ int int_;
+ int dex;
+ int luk;
+ int8 spiritball; //for homun S [lighta]
};
struct s_mercenary {