From 2ab8949ba5646b588886c2a4d15679e59883a4e6 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sun, 5 Apr 2020 18:52:06 +0200 Subject: [PATCH] cmake: Place Windows exclusive functionality into own file --- CMakeLists.txt | 1 + source/plugin.cpp | 12 ------------ source/windll.cpp | 25 +++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 12 deletions(-) create mode 100644 source/windll.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index fd98a84f..4bbd185e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -494,6 +494,7 @@ if(WIN32) "cmake/version.rc.in" ) list(APPEND PROJECT_PRIVATE_SOURCE + "source/windll.cpp" ) endif() diff --git a/source/plugin.cpp b/source/plugin.cpp index b143b17c..2f0c820c 100644 --- a/source/plugin.cpp +++ b/source/plugin.cpp @@ -185,18 +185,6 @@ try { LOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -#ifdef _WIN32 -// Windows Only -extern "C" { -#include -} - -BOOL WINAPI DllMain(HINSTANCE, DWORD, LPVOID) -{ - return TRUE; -} -#endif - std::shared_ptr get_global_threadpool() { return global_threadpool; diff --git a/source/windll.cpp b/source/windll.cpp new file mode 100644 index 00000000..30b9cd6e --- /dev/null +++ b/source/windll.cpp @@ -0,0 +1,25 @@ +/* + * Modern effects for a modern Streamer + * Copyright (C) 2020 Michael Fabian Dirks + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +BOOL WINAPI DllMain(HINSTANCE, DWORD, LPVOID) +{ + return TRUE; +}