From 4ba48484ae75b43ff625d433bbb698e3cfcbf51f Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sat, 17 Nov 2018 12:01:55 -0800 Subject: [PATCH] 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. --- UI/CMakeLists.txt | 2 +- UI/window-basic-main.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/UI/CMakeLists.txt b/UI/CMakeLists.txt index edfb7f1b1..1f4bcbafe 100644 --- a/UI/CMakeLists.txt +++ b/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() diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index de180c292..491d1829f 100644 --- a/UI/window-basic-main.cpp +++ b/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 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();