GMIC: add missing requires, fix OS detection

This commit is contained in:
Gerasim Troeglazov
2021-10-03 00:04:53 +10:00
parent 343b70ec2f
commit 73f4920c2c
2 changed files with 47 additions and 19 deletions

View File

@@ -1,25 +1,9 @@
From 8571f5d46af6675f7c23b9fcd4e95c0577de9320 Mon Sep 17 00:00:00 2001
From 4ad3c1d9c998b6d07f783f4834ac854440713d11 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Fri, 1 Oct 2021 20:50:15 +1000
Subject: Fix build for Haiku
diff --git a/src/gmic.h b/src/gmic.h
index 6698bc0..1546281 100644
--- a/src/gmic.h
+++ b/src/gmic.h
@@ -51,6 +51,11 @@
#
*/
+#ifdef __HAIKU__
+#include <sys/types.h>
+#include <sys/stat.h>
+#endif
+
#ifndef gmic_version
#define gmic_version 299
diff --git a/gmic-qt/CMakeLists.txt b/gmic-qt/CMakeLists.txt
index 93119fa..149a61b 100644
--- a/gmic-qt/CMakeLists.txt
@@ -44,6 +28,45 @@ index 93119fa..149a61b 100644
if (WIN32)
add_definitions(-Dcimg_display=2)
add_definitions(-DPSAPI_VERSION=1)
diff --git a/src/gmic.h b/src/gmic.h
index 6698bc0..1546281 100644
--- a/src/gmic.h
+++ b/src/gmic.h
@@ -51,6 +51,11 @@
#
*/
+#ifdef __HAIKU__
+#include <sys/types.h>
+#include <sys/stat.h>
+#endif
+
#ifndef gmic_version
#define gmic_version 299
--
2.30.2
From ded9d6f8c2b1c814d4674a554baedcad0b726f52 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sun, 3 Oct 2021 00:00:52 +1000
Subject: Add Haiku to detected OS
diff --git a/src/CImg.h b/src/CImg.h
index efdbaf4..da43a30 100644
--- a/src/CImg.h
+++ b/src/CImg.h
@@ -7124,6 +7124,8 @@ namespace cimg_library_suffixed {
static const char *const str = "Irix";
#elif defined(__MACOSX__) || defined(__APPLE__)
static const char *const str = "Mac OS";
+#elif defined(__HAIKU__)
+ static const char *const str = "Haiku";
#elif defined(unix) || defined(__unix) || defined(__unix__)
static const char *const str = "Generic Unix";
#elif defined(_MSC_VER) || defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || \
--
2.30.2