[Bf-blender-cvs] [6a0cb481491] master: GHOST: cleanup platform checks, fix Wayland + X11

Campbell Barton noreply at git.blender.org
Sun May 3 12:33:01 CEST 2020


Commit: 6a0cb481491384a5c7338f4723b7d44f490d4f76
Author: Campbell Barton
Date:   Sun May 3 20:22:21 2020 +1000
Branches: master
https://developer.blender.org/rB6a0cb481491384a5c7338f4723b7d44f490d4f76

GHOST: cleanup platform checks, fix Wayland + X11

- Building with Wayland + X11 missed an exception include.
- Move HEADLESS check first, since it's the same on all platforms.

===================================================================

M	intern/ghost/intern/GHOST_ISystem.cpp

===================================================================

diff --git a/intern/ghost/intern/GHOST_ISystem.cpp b/intern/ghost/intern/GHOST_ISystem.cpp
index 9e3bf66d925..7c12bfe0306 100644
--- a/intern/ghost/intern/GHOST_ISystem.cpp
+++ b/intern/ghost/intern/GHOST_ISystem.cpp
@@ -27,25 +27,22 @@
 
 #include "GHOST_ISystem.h"
 
-#if defined(WITH_GHOST_X11) || defined(WITH_GHOST_WAYLAND)
-#  ifdef WITH_GHOST_X11
-#    include "GHOST_SystemX11.h"
-#  endif
-#  ifdef WITH_GHOST_WAYLAND
-#    include "GHOST_SystemWayland.h"
-#  endif
-#else
-#  ifdef WITH_HEADLESS
-#    include "GHOST_SystemNULL.h"
-#  elif defined(WITH_GHOST_SDL)
-#    include "GHOST_SystemSDL.h"
-#  elif defined(WIN32)
-#    include "GHOST_SystemWin32.h"
-#  else
-#    ifdef __APPLE__
-#      include "GHOST_SystemCocoa.h"
-#    endif
-#  endif
+#if defined(WITH_HEADLESS)
+#  include "GHOST_SystemNULL.h"
+#elif defined(WITH_GHOST_X11) && defined(WITH_GHOST_WAYLAND)
+#  include "GHOST_SystemWayland.h"
+#  include "GHOST_SystemX11.h"
+#  include <stdexcept>
+#elif defined(WITH_GHOST_X11)
+#  include "GHOST_SystemX11.h"
+#elif defined(WITH_GHOST_WAYLAND)
+#  include "GHOST_SystemWayland.h"
+#elif defined(WITH_GHOST_SDL)
+#  include "GHOST_SystemSDL.h"
+#elif defined(WIN32)
+#  include "GHOST_SystemWin32.h"
+#elif defined(__APPLE__)
+#  include "GHOST_SystemCocoa.h"
 #endif
 
 GHOST_ISystem *GHOST_ISystem::m_system = NULL;
@@ -54,7 +51,9 @@ GHOST_TSuccess GHOST_ISystem::createSystem()
 {
   GHOST_TSuccess success;
   if (!m_system) {
-#if defined(WITH_GHOST_X11) && defined(WITH_GHOST_WAYLAND)
+#if defined(WITH_HEADLESS)
+    m_system = new GHOST_SystemNULL();
+#elif defined(WITH_GHOST_X11) && defined(WITH_GHOST_WAYLAND)
     /* Special case, try Wayland, fall back to X11. */
     try {
       m_system = new GHOST_SystemWayland();
@@ -69,16 +68,12 @@ GHOST_TSuccess GHOST_ISystem::createSystem()
     m_system = new GHOST_SystemX11();
 #elif defined(WITH_GHOST_WAYLAND)
     m_system = new GHOST_SystemWayland();
-#elif defined(WITH_HEADLESS)
-    m_system = new GHOST_SystemNULL();
 #elif defined(WITH_GHOST_SDL)
     m_system = new GHOST_SystemSDL();
 #elif defined(WIN32)
     m_system = new GHOST_SystemWin32();
-#else
-#  ifdef __APPLE__
+#elif defined(__APPLE__)
     m_system = new GHOST_SystemCocoa();
-#  endif
 #endif
     success = m_system != NULL ? GHOST_kSuccess : GHOST_kFailure;
   }



More information about the Bf-blender-cvs mailing list