Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-05-03 13:22:21 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-05-03 13:24:24 +0300
commit6a0cb481491384a5c7338f4723b7d44f490d4f76 (patch)
treeae1afc8f7afb696b3fa2d428feb3a3be1f886ffb /intern/ghost
parenta6380d063f607b46653ccc1106bd603e84c01c3d (diff)
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.
Diffstat (limited to 'intern/ghost')
-rw-r--r--intern/ghost/intern/GHOST_ISystem.cpp45
1 files changed, 20 insertions, 25 deletions
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;
}