diff options
author | sluicebox | 2019-02-20 16:05:46 -0800 |
---|---|---|
committer | Filippos Karapetis | 2019-03-02 10:01:37 +0200 |
commit | e67b8501bf5e71a5aa453ec75f8a6faf65cc1213 (patch) | |
tree | 9e126b0cf226008838472f9690332aab038306e7 /base | |
parent | 205df5dbdfc75d051d1d74e997dbd88208cbbdf1 (diff) | |
download | scummvm-rg350-e67b8501bf5e71a5aa453ec75f8a6faf65cc1213.tar.gz scummvm-rg350-e67b8501bf5e71a5aa453ec75f8a6faf65cc1213.tar.bz2 scummvm-rg350-e67b8501bf5e71a5aa453ec75f8a6faf65cc1213.zip |
WIN32: Fix embedding disabled engine files
Fix Windows builds (msvc and mingw) including data files from disabled
engines as embedded resources in executable. Bug #10878
Diffstat (limited to 'base')
-rw-r--r-- | base/internal_plugins.h | 19 | ||||
-rw-r--r-- | base/plugins.h | 17 |
2 files changed, 23 insertions, 13 deletions
diff --git a/base/internal_plugins.h b/base/internal_plugins.h new file mode 100644 index 0000000000..1af1607022 --- /dev/null +++ b/base/internal_plugins.h @@ -0,0 +1,19 @@ +#if !defined(INCLUDED_FROM_BASE_PLUGINS_H) && !defined(RC_INVOKED) +#error This file may only be included by base/plugins.h or dists/scummvm.rc +#endif + +// plugin macros are defined in this simple internal header so that scummvm.rc +// can include them without causing problems for Windows resource compilers. + +#define STATIC_PLUGIN 1 +#define DYNAMIC_PLUGIN 2 + +#define PLUGIN_ENABLED_STATIC(ID) \ + (ENABLE_##ID && !PLUGIN_ENABLED_DYNAMIC(ID)) + +#ifdef DYNAMIC_MODULES + #define PLUGIN_ENABLED_DYNAMIC(ID) \ + (ENABLE_##ID && (ENABLE_##ID == DYNAMIC_PLUGIN)) +#else + #define PLUGIN_ENABLED_DYNAMIC(ID) 0 +#endif diff --git a/base/plugins.h b/base/plugins.h index 3ad2875906..bfeb68ae2d 100644 --- a/base/plugins.h +++ b/base/plugins.h @@ -28,6 +28,10 @@ #include "common/str.h" #include "backends/plugins/elf/version.h" +#define INCLUDED_FROM_BASE_PLUGINS_H +#include "base/internal_plugins.h" +#undef INCLUDED_FROM_BASE_PLUGINS_H + /** * @page pagePlugins An overview of the ScummVM plugin system @@ -73,19 +77,6 @@ extern int pluginTypeVersions[PLUGIN_TYPE_MAX]; // Plugin linking -#define STATIC_PLUGIN 1 -#define DYNAMIC_PLUGIN 2 - -#define PLUGIN_ENABLED_STATIC(ID) \ - (ENABLE_##ID && !PLUGIN_ENABLED_DYNAMIC(ID)) - -#ifdef DYNAMIC_MODULES - #define PLUGIN_ENABLED_DYNAMIC(ID) \ - (ENABLE_##ID && (ENABLE_##ID == DYNAMIC_PLUGIN)) -#else - #define PLUGIN_ENABLED_DYNAMIC(ID) 0 -#endif - // see comments in backends/plugins/elf/elf-provider.cpp #if defined(USE_ELF_LOADER) && defined(ELF_LOADER_CXA_ATEXIT) #define PLUGIN_DYNAMIC_DSO_HANDLE \ |