mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-06 06:58:57 +02:00
88 lines
2.1 KiB
Plaintext
88 lines
2.1 KiB
Plaintext
From 0d155647f10278b130cf4cd74489665177656d35 Mon Sep 17 00:00:00 2001
|
|
From: Jerome Duval <jerome.duval@gmail.com>
|
|
Date: Sun, 7 Jun 2015 22:05:26 +0000
|
|
Subject: Haiku patch
|
|
|
|
|
|
diff --git a/src/libutil/farmhash.cpp b/src/libutil/farmhash.cpp
|
|
index 05250a6..2a2e0fa 100644
|
|
--- a/src/libutil/farmhash.cpp
|
|
+++ b/src/libutil/farmhash.cpp
|
|
@@ -159,6 +159,13 @@
|
|
#define bswap_64(x) bswap64(x)
|
|
#endif
|
|
|
|
+#elif defined(__HAIKU__)
|
|
+
|
|
+#undef bswap_32
|
|
+#undef bswap_64
|
|
+#define bswap_32 __builtin_bswap32
|
|
+#define bswap_64 __builtin_bswap64
|
|
+
|
|
#else
|
|
|
|
#undef bswap_32
|
|
diff --git a/src/libutil/sysutil.cpp b/src/libutil/sysutil.cpp
|
|
index dda7bc7..75151a5 100644
|
|
--- a/src/libutil/sysutil.cpp
|
|
+++ b/src/libutil/sysutil.cpp
|
|
@@ -77,6 +77,12 @@
|
|
# include <sys/ioctl.h>
|
|
#endif
|
|
|
|
+#if defined (__HAIKU__)
|
|
+# include <sys/types.h>
|
|
+# include <sys/resource.h>
|
|
+# include <unistd.h>
|
|
+#endif
|
|
+
|
|
#include <OpenImageIO/dassert.h>
|
|
#include <OpenImageIO/sysutil.h>
|
|
#include <OpenImageIO/strutil.h>
|
|
@@ -255,7 +261,7 @@ Sysutil::this_program_path ()
|
|
size_t cb = sizeof(filename);
|
|
int r=1;
|
|
sysctl(mib, 4, filename, &cb, NULL, 0);
|
|
-#elif defined(__GNU__) || defined(__OpenBSD__)
|
|
+#elif defined(__GNU__) || defined(__OpenBSD__) || defined(__HAIKU__)
|
|
int r = 0;
|
|
#else
|
|
// No idea what platform this is
|
|
diff --git a/src/libutil/xxhash.cpp b/src/libutil/xxhash.cpp
|
|
index cfb1278..ef6698a 100644
|
|
--- a/src/libutil/xxhash.cpp
|
|
+++ b/src/libutil/xxhash.cpp
|
|
@@ -126,8 +126,10 @@ typedef unsigned long long U64;
|
|
#if defined(__GNUC__) && !defined(XXH_USE_UNALIGNED_ACCESS)
|
|
# define _PACKED __attribute__ ((packed))
|
|
#else
|
|
+#ifndef __HAIKU__
|
|
# define _PACKED
|
|
#endif
|
|
+#endif
|
|
|
|
#if !defined(XXH_USE_UNALIGNED_ACCESS) && !defined(__GNUC__)
|
|
# ifdef __IBMC__
|
|
diff --git a/src/make/detectplatform.mk b/src/make/detectplatform.mk
|
|
index dacdc2e..4918389 100644
|
|
--- a/src/make/detectplatform.mk
|
|
+++ b/src/make/detectplatform.mk
|
|
@@ -46,6 +46,14 @@ ifeq (${platform},unknown)
|
|
endif
|
|
endif
|
|
|
|
+ # Haiku
|
|
+ ifeq (${uname},haiku)
|
|
+ platform := haiku
|
|
+ ifeq (${hw},x86_64)
|
|
+ platform := haiku64
|
|
+ endif
|
|
+ endif
|
|
+
|
|
# Windows
|
|
ifeq (${uname},cygwin)
|
|
platform := windows
|
|
--
|
|
2.15.0
|
|
|