Ver Fonte

UI: Only def. BROWSER_AVAILABLE for WIN32 (for now)

Currently, browser panel is only supported on windows.  So rather than
have to check for _WIN32 in the code everywhere, just move the WIN32
check to cmake, that way we don't have to have _WIN32 checks in the code
everywhere the browser panel code is used, and do not have to remove a
whole bunch of unnecessary _WIN32 #ifdefs for other operating systems
when browser panel support is added for them.
jp9000 há 7 anos atrás
pai
commit
4ba48484ae
2 ficheiros alterados com 4 adições e 4 exclusões
  1. 1 1
      UI/CMakeLists.txt
  2. 3 3
      UI/window-basic-main.cpp

+ 1 - 1
UI/CMakeLists.txt

@@ -7,7 +7,7 @@ else()
 	set(FIND_MODE QUIET)
 endif()
 
-if(BROWSER_AVAILABLE_INTERNAL)
+if(BROWSER_AVAILABLE_INTERNAL AND WIN32)
 	add_definitions(-DBROWSER_AVAILABLE)
 endif()
 

+ 3 - 3
UI/window-basic-main.cpp

@@ -74,7 +74,7 @@
 using namespace json11;
 using namespace std;
 
-#if defined(_WIN32) && defined(BROWSER_AVAILABLE)
+#ifdef BROWSER_AVAILABLE
 #include <browser-panel.hpp>
 static CREATE_BROWSER_WIDGET_PROC create_browser_widget = nullptr;
 #endif
@@ -1530,7 +1530,7 @@ void OBSBasic::OBSInit()
 	blog(LOG_INFO, "---------------------------------");
 	obs_post_load_modules();
 
-#if defined(_WIN32) && defined(BROWSER_AVAILABLE)
+#ifdef BROWSER_AVAILABLE
 	create_browser_widget = obs_browser_init_panel();
 #endif
 
@@ -1761,7 +1761,7 @@ void OBSBasic::OnFirstLoad()
 	if (api)
 		api->on_event(OBS_FRONTEND_EVENT_FINISHED_LOADING);
 
-#if defined(_WIN32) && defined(BROWSER_AVAILABLE)
+#ifdef BROWSER_AVAILABLE
 	/* Attempt to load init screen if available */
 	if (create_browser_widget) {
 		WhatsNewInfoThread *wnit = new WhatsNewInfoThread();