ref: a99ae524a27afd38a252325abece355962c8cf6f
parent: 51464beb7f84774ba19cb9fe2cf2e7ace25ae2c3
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Fri Jan 15 15:10:39 EST 2021
plan9: fix compilation on 386 and arm
--- a/src/mkfile
+++ b/src/mkfile
@@ -2,7 +2,7 @@
LIB=libdav1d.$objtype.a
-CFLAGS=$CFLAGS -DNDEBUG -I../include/dav1d -I.. -I../include -Iplan9 -p -D__plan9__ -DBITDEPTH=8
+CFLAGS=$CFLAGS -DNDEBUG -I../include/dav1d -I.. -I../include -Iplan9 -p -D__plan9__ -D__${objtype}__ -DBITDEPTH=8
HFILES=\
--- a/src/plan9/config.h
+++ b/src/plan9/config.h
@@ -1,21 +1,44 @@
#ifndef __plan9_config_h__
#define __plan9_config_h__
-#define ARCH_AARCH64 0
-#define ARCH_ARM 0
#define ARCH_PPC64LE 0
+
+#ifdef __386__
#define ARCH_X86 1
+#define ARCH_X86_32 1
+#define ARCH_X86_64 0
+#define ARCH_AARCH64 0
+#elif defined(__amd64__)
+#define ARCH_X86 1
#define ARCH_X86_32 0
#define ARCH_X86_64 1
-#define CONFIG_16BPC 1
-#define CONFIG_8BPC 1
-#define CONFIG_LOG 1
+#define ARCH_AARCH64 0
+#elif defined(__arm64__)
+#define ARCH_X86 0
+#define ARCH_X86_32 0
+#define ARCH_X86_64 0
+#define ARCH_ARM 1
+#define ARCH_AARCH64 1
+#elif defined(__arm__)
+#define ARCH_X86 0
+#define ARCH_X86_32 0
+#define ARCH_X86_64 0
+#define ARCH_ARM 1
+#define ARCH_AARCH64 0
+#endif
#define ENDIANNESS_BIG 0
+
#define HAVE_ASM 0
#define HAVE_AVX512ICL 0
+
+#define STACK_ALIGNMENT 0
+
+#define CONFIG_16BPC 1
+#define CONFIG_8BPC 1
+#define CONFIG_LOG 1
+
#define HAVE_CLOCK_GETTIME 0
#define HAVE_ALIGNED_MALLOC 1
#define HAVE_UNISTD_H 1
-#define STACK_ALIGNMENT 0
#endif
--- a/src/plan9/plan9.h
+++ b/src/plan9/plan9.h
@@ -24,11 +24,11 @@
typedef u16int uint16_t;
typedef s32int int32_t;
typedef u32int uint32_t;
-typedef vlong int64_t;
-typedef uvlong uint64_t;
-typedef uvlong size_t;
-typedef vlong ptrdiff_t;
-typedef vlong intptr_t;
+typedef s64int int64_t;
+typedef u64int uint64_t;
+typedef usize size_t;
+typedef intptr ptrdiff_t;
+typedef intptr intptr_t;
typedef uintptr uintptr_t;
typedef long atomic_int;
typedef long atomic_uint;
@@ -41,11 +41,11 @@
#define INT_MIN (-INT_MAX-1)
#define INT16_MIN ((int16_t)0x8000)
#define INT16_MAX 0x7fff
-#define SIZE_MAX 0xffffffffffffffffULL
+#define SIZE_MAX 0xffffffffU
#define INT64_MIN ((int64_t)0x8000000000000000ULL)
#define SHRT_MAX 0x7fff
#define SHRT_MIN (-SHRT_MAX-1)
-#define PRIu64 "zu"
+#define PRIu64 "llud"
#define memory_order_acquire 0
#define memory_order_relaxed 1