summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-02-02 18:48:13 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-02-02 18:48:24 +0100
commit6276822e9e8f505756b386637df9e14dd5a8e2fb (patch)
tree9294dc6114e2d92ea4eef6041a6809e2e4c44a27
parent4e75549e7bd8b0ea032cf279066d0fac09577067 (diff)
Allow cmake -DOPTION_APPLE_X11=On without -U__APPLE__
-rw-r--r--CMake/setup.cmake4
-rw-r--r--FL/platform.H6
-rw-r--r--cairo/Fl_Cairo.cxx6
-rw-r--r--configure.ac3
-rw-r--r--src/drivers/Posix/Fl_Posix_System_Driver.cxx10
-rw-r--r--test/menubar.cxx5
6 files changed, 20 insertions, 14 deletions
diff --git a/CMake/setup.cmake b/CMake/setup.cmake
index e89ecc7cc..bc98aa58e 100644
--- a/CMake/setup.cmake
+++ b/CMake/setup.cmake
@@ -2,7 +2,7 @@
# CMakeLists.txt to build the FLTK project using CMake (www.cmake.org)
# Originally written by Michael Surette
#
-# Copyright 1998-2022 by Bill Spitzak and others.
+# Copyright 1998-2023 by Bill Spitzak and others.
#
# This library is free software. Distribution and use rights are outlined in
# the file "COPYING" which should have been included with this file. If this
@@ -97,8 +97,6 @@ if (APPLE)
set (HAVE_SCANDIR 1)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
if (OPTION_APPLE_X11)
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -U__APPLE__")
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U__APPLE__")
if (NOT(${CMAKE_SYSTEM_VERSION} VERSION_LESS 17.0.0)) # a.k.a. macOS version ≥ 10.13
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LIBCPP_HAS_THREAD_API_PTHREAD")
endif (NOT(${CMAKE_SYSTEM_VERSION} VERSION_LESS 17.0.0))
diff --git a/FL/platform.H b/FL/platform.H
index 6d757387e..715a10c64 100644
--- a/FL/platform.H
+++ b/FL/platform.H
@@ -1,7 +1,7 @@
//
// Platform header file for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2022 by Bill Spitzak and others.
+// Copyright 1998-2023 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -35,12 +35,12 @@ class Fl_Window;
# ifdef _WIN32
# include "win32.H"
-# elif defined(__APPLE__)
-# include "mac.H"
# elif defined(FLTK_USE_WAYLAND)
# include "wayland.H"
# elif defined(FLTK_USE_X11)
# include "x11.H"
+# elif defined(__APPLE__)
+# include "mac.H"
# endif // _WIN32
//
diff --git a/cairo/Fl_Cairo.cxx b/cairo/Fl_Cairo.cxx
index a8a63b383..2def2698a 100644
--- a/cairo/Fl_Cairo.cxx
+++ b/cairo/Fl_Cairo.cxx
@@ -1,7 +1,7 @@
//
// Special Cairo support for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2022 by Bill Spitzak and others.
+// Copyright 1998-2023 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -34,8 +34,6 @@
#if defined(_WIN32) // Windows
# include <cairo-win32.h>
-#elif defined(__APPLE__) // macOS
-# include <cairo-quartz.h>
#elif defined(FLTK_USE_WAYLAND) // Wayland or hybrid
# include "../src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H"
# include "../src/drivers/Wayland/Fl_Wayland_Window_Driver.H"
@@ -46,6 +44,8 @@
# endif
#elif defined(FLTK_USE_X11) // X11
# include <cairo-xlib.h>
+#elif defined(__APPLE__) // macOS
+# include <cairo-quartz.h>
#else
# error Cairo is not supported on this platform.
#endif
diff --git a/configure.ac b/configure.ac
index 410aebd99..16d5e2611 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@ dnl the "configure" script is made from this by running GNU "autoconf"
dnl
dnl Configuration script for the Fast Light Tool Kit (FLTK).
dnl
-dnl Copyright 1998-2022 by Bill Spitzak and others.
+dnl Copyright 1998-2023 by Bill Spitzak and others.
dnl
dnl This library is free software. Distribution and use rights are outlined in
dnl the file "COPYING" which should have been included with this file. If this
@@ -185,7 +185,6 @@ AS_CASE([$host_os], [cygwin*], [
], [darwin*], [
AS_IF([test x$enable_x11 = xyes], [
host_os_gui="X11"
- OPTIM="-U__APPLE__ $OPTIM"
macosversion=$(sw_vers -productVersion | cut -d. -f2)
macosversion_maj=$(sw_vers -productVersion | cut -d. -f1)
AS_IF([test $macosversion_maj -ge 11 -o $macosversion -ge 13], [
diff --git a/src/drivers/Posix/Fl_Posix_System_Driver.cxx b/src/drivers/Posix/Fl_Posix_System_Driver.cxx
index d8075775d..6d5231365 100644
--- a/src/drivers/Posix/Fl_Posix_System_Driver.cxx
+++ b/src/drivers/Posix/Fl_Posix_System_Driver.cxx
@@ -1,7 +1,7 @@
//
// Definition of Posix system driver (used by the X11, Wayland and macOS platforms).
//
-// Copyright 1998-2022 by Bill Spitzak and others.
+// Copyright 1998-2023 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -262,7 +262,13 @@ bool Fl_Posix_System_Driver::probe_for_GTK(int major, int minor, void **p_ptr_gt
#endif
} else {
// Try then with GTK2
- Fl_Posix_System_Driver::ptr_gtk = Fl_Posix_System_Driver::dlopen_or_dlsym("libgtk-x11-2.0");
+ Fl_Posix_System_Driver::ptr_gtk = Fl_Posix_System_Driver::dlopen_or_dlsym(
+#ifdef __APPLE__
+ "libgtkmacintegration-gtk2"
+#else
+ "libgtk-x11-2.0"
+#endif
+ );
#ifdef DEBUG
if (Fl_Posix_System_Driver::ptr_gtk) {
puts("selected GTK-2\n");
diff --git a/test/menubar.cxx b/test/menubar.cxx
index f8b1aaffc..a1c7bc7fe 100644
--- a/test/menubar.cxx
+++ b/test/menubar.cxx
@@ -1,7 +1,7 @@
//
// Menubar test program for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2020 by Bill Spitzak and others.
+// Copyright 1998-2023 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -15,6 +15,9 @@
//
#include <FL/Fl.H>
+#if defined(FLTK_USE_X11) && defined(__APPLE__)
+# undef __APPLE__
+#endif
#ifdef __APPLE__
#include <FL/platform.H> // for Fl_Mac_App_Menu
#endif