From: <man...@us...> - 2013-05-30 18:38:41
|
Revision: 2234 http://sourceforge.net/p/modplug/code/2234 Author: manxorist Date: 2013-05-30 18:38:34 +0000 (Thu, 30 May 2013) Log Message: ----------- [Ref] Simplify symbol export for xmp-openmpt.dll. [Ref] Do not build winamp or xmplay plugin if libopenmpt is not built as a dll. Modified Paths: -------------- trunk/OpenMPT/common/BuildSettings.h trunk/OpenMPT/libopenmpt/libopenmpt.vcxproj trunk/OpenMPT/libopenmpt/libopenmpt.vcxproj.filters trunk/OpenMPT/libopenmpt/libopenmpt_xmplay.cpp Removed Paths: ------------- trunk/OpenMPT/libopenmpt/libopenmpt_xmplay_c.c trunk/OpenMPT/libopenmpt/xmpin.def Modified: trunk/OpenMPT/common/BuildSettings.h =================================================================== --- trunk/OpenMPT/common/BuildSettings.h 2013-05-30 18:08:56 UTC (rev 2233) +++ trunk/OpenMPT/common/BuildSettings.h 2013-05-30 18:38:34 UTC (rev 2234) @@ -173,8 +173,20 @@ #undef MODPLUG_NO_FILESAVE // tests require file saving #endif +#if !defined(NO_WINAMP) +#if !defined(LIBOPENMPT_BUILD) || (defined(LIBOPENMPT_BUILD) && !defined(LIBOPENMPT_BUILD_DLL)) +#define NO_WINAMP // winamp plugin requires libopenmpt dll build +#endif +#endif +#if !defined(NO_XMPLAY) +#if !defined(LIBOPENMPT_BUILD) || (defined(LIBOPENMPT_BUILD) && !defined(LIBOPENMPT_BUILD_DLL)) +#define NO_XMPLAY // xmplay plugin requires libopenmpt dll build +#endif +#endif + + #if MPT_COMPILER_MSVC #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #endif Modified: trunk/OpenMPT/libopenmpt/libopenmpt.vcxproj =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt.vcxproj 2013-05-30 18:08:56 UTC (rev 2233) +++ trunk/OpenMPT/libopenmpt/libopenmpt.vcxproj 2013-05-30 18:38:34 UTC (rev 2234) @@ -130,7 +130,6 @@ </ClCompile> <Link> <GenerateDebugInformation>true</GenerateDebugInformation> - <ModuleDefinitionFile>xmpin.def</ModuleDefinitionFile> <DelayLoadDLLs>libopenmpt_settings.dll</DelayLoadDLLs> </Link> <PreBuildEvent> @@ -151,7 +150,6 @@ </ClCompile> <Link> <GenerateDebugInformation>true</GenerateDebugInformation> - <ModuleDefinitionFile>xmpin.def</ModuleDefinitionFile> <DelayLoadDLLs>libopenmpt_settings.dll</DelayLoadDLLs> </Link> <PreBuildEvent> @@ -218,7 +216,6 @@ <GenerateDebugInformation>true</GenerateDebugInformation> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> - <ModuleDefinitionFile>xmpin.def</ModuleDefinitionFile> <DelayLoadDLLs>libopenmpt_settings.dll</DelayLoadDLLs> </Link> <PreBuildEvent> @@ -251,7 +248,6 @@ <GenerateDebugInformation>true</GenerateDebugInformation> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> - <ModuleDefinitionFile>xmpin.def</ModuleDefinitionFile> <DelayLoadDLLs>libopenmpt_settings.dll</DelayLoadDLLs> </Link> <PreBuildEvent> @@ -470,16 +466,6 @@ <ClCompile Include="libopenmpt_version.cpp" /> <ClCompile Include="libopenmpt_winamp.cpp" /> <ClCompile Include="libopenmpt_xmplay.cpp" /> - <ClCompile Include="libopenmpt_xmplay_c.c"> - <CompileAs Condition="'$(Configuration)|$(Platform)'=='DebugStatic|Win32'">CompileAsC</CompileAs> - <CompileAs Condition="'$(Configuration)|$(Platform)'=='DebugStatic|x64'">CompileAsC</CompileAs> - <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsC</CompileAs> - <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsC</CompileAs> - <CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseStatic|Win32'">CompileAsC</CompileAs> - <CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseStatic|x64'">CompileAsC</CompileAs> - <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsC</CompileAs> - <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsC</CompileAs> - </ClCompile> </ItemGroup> <ItemGroup> <ProjectReference Include="..\include\zlib\contrib\vstudio\vc10\zlibstat.vcxproj"> Modified: trunk/OpenMPT/libopenmpt/libopenmpt.vcxproj.filters =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt.vcxproj.filters 2013-05-30 18:08:56 UTC (rev 2233) +++ trunk/OpenMPT/libopenmpt/libopenmpt.vcxproj.filters 2013-05-30 18:38:34 UTC (rev 2234) @@ -458,9 +458,6 @@ <ClCompile Include="libopenmpt_xmplay.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="libopenmpt_xmplay_c.c"> - <Filter>Source Files</Filter> - </ClCompile> <ClCompile Include="..\soundlib\Load_digi.cpp"> <Filter>Source Files\soundlib</Filter> </ClCompile> Modified: trunk/OpenMPT/libopenmpt/libopenmpt_xmplay.cpp =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_xmplay.cpp 2013-05-30 18:08:56 UTC (rev 2233) +++ trunk/OpenMPT/libopenmpt/libopenmpt_xmplay.cpp 2013-05-30 18:38:34 UTC (rev 2234) @@ -895,9 +895,7 @@ xmpin.exts = NULL; } -extern "C" { - -XMPIN * XMPIN_GetInterface_cxx( DWORD face, InterfaceProc faceproc ) { +static XMPIN * XMPIN_GetInterface_cxx( DWORD face, InterfaceProc faceproc ) { if (face!=XMPIN_FACE) return NULL; xmpfin=(XMPFUNC_IN*)faceproc(XMPFUNC_IN_FACE); xmpfmisc=(XMPFUNC_MISC*)faceproc(XMPFUNC_MISC_FACE); @@ -907,6 +905,14 @@ return &xmpin; } +extern "C" { + +// XMPLAY expects a WINAPI (which is __stdcall) function using an undecorated symbol name. +XMPIN * WINAPI XMPIN_GetInterface( DWORD face, InterfaceProc faceproc ) { + return XMPIN_GetInterface_cxx( face, faceproc ); +} +#pragma comment(linker, "/EXPORT:XMPIN_GetInterface=_XMPIN_GetInterface@8") + }; // extern "C" #endif // NO_XMPLAY Deleted: trunk/OpenMPT/libopenmpt/libopenmpt_xmplay_c.c =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_xmplay_c.c 2013-05-30 18:08:56 UTC (rev 2233) +++ trunk/OpenMPT/libopenmpt/libopenmpt_xmplay_c.c 2013-05-30 18:38:34 UTC (rev 2234) @@ -1,34 +0,0 @@ -/* - * libopenmpt_xmplay_c.c - * --------------------- - * Purpose: libopenmpt xmplay input plugin interface - * Notes : (currently none) - * Authors: OpenMPT Devs - * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. - */ - -#include "BuildSettings.h" - -#ifndef NO_XMPLAY - -#include "xmplay/xmpin.h" - -XMPIN * XMPIN_GetInterface_cxx( DWORD face, InterfaceProc faceproc ); -// Stupid MSVC does not undecorate function name when using linker pragma. -// So, we have to use EXPORTS in the .def file. -/*LIBOPENMPT_XMPLAY_API*/ XMPIN * WINAPI XMPIN_GetInterface( DWORD face, InterfaceProc faceproc ) { - return XMPIN_GetInterface_cxx( face, faceproc ); -} -//#pragma comment(linker, "/EXPORT:XMPIN_GetInterface") - -#else // !NO_XMPLAY - -#ifdef _MSC_VER -#include <windows.h> -// to prevent linking failure with symbols from .def file ... this is getting complicated -void * XMPIN_GetInterface( DWORD face, void * faceproc ) { - return NULL; -} -#endif // _MSC_VER - -#endif // NO_XMPLAY Deleted: trunk/OpenMPT/libopenmpt/xmpin.def =================================================================== --- trunk/OpenMPT/libopenmpt/xmpin.def 2013-05-30 18:08:56 UTC (rev 2233) +++ trunk/OpenMPT/libopenmpt/xmpin.def 2013-05-30 18:38:34 UTC (rev 2234) @@ -1,2 +0,0 @@ -EXPORTS -XMPIN_GetInterface This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |