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.
master
jp9000 2018-11-17 12:01:55 -08:00
parent c482f463e0
commit 4ba48484ae
2 changed files with 4 additions and 4 deletions

View File

@ -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()

View File

@ -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();