Kaydet (Commit) 28b4f4ae authored tarafından Stephan Bergmann's avatar Stephan Bergmann Kaydeden (comit) Mike Kaganski

Get rid of Windows .def files in setup_native, use __declspec(dllexport)

For one, replacing the dated .def files with equivalent functionality should be
a good move all by itself.  And for another, it paves the way for using
loplugin:external with clang-cl on Windows, which uses the heuristic of not
warning about functions that are explicitly marked as __declspec(dllexport).

Change-Id: I6efd50a8c5ce2a166ca0dd4e5f472118f3f9a071
Reviewed-on: https://gerrit.libreoffice.org/60691
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst b9a2d00c
......@@ -18,7 +18,6 @@ $(eval $(call gb_Library_add_cxxflags,inst_msu_msi,\
))
$(eval $(call gb_Library_add_ldflags,inst_msu_msi,\
/DEF:$(SRCDIR)/setup_native/source/win32/customactions/inst_msu/inst_msu_msi.def \
/NODEFAULTLIB \
))
......
......@@ -18,7 +18,6 @@ $(eval $(call gb_Library_add_cxxflags,instooofiltmsi,\
))
$(eval $(call gb_Library_add_ldflags,instooofiltmsi,\
/DEF:$(SRCDIR)/setup_native/source/win32/customactions/indexingfilter/instooofiltmsi.def \
/NODEFAULTLIB \
))
......
......@@ -18,7 +18,6 @@ $(eval $(call gb_Library_add_cxxflags,qslnkmsi,\
))
$(eval $(call gb_Library_add_ldflags,qslnkmsi,\
/DEF:$(SRCDIR)/setup_native/source/win32/customactions/quickstarter/qslnkmsi.def \
/NODEFAULTLIB \
))
......
......@@ -20,7 +20,6 @@ $(eval $(call gb_Library_add_cxxflags,reg4allmsdoc,\
))
$(eval $(call gb_Library_add_ldflags,reg4allmsdoc,\
/DEF:$(SRCDIR)/setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsdoc.def \
/NODEFAULTLIB \
))
......
......@@ -18,7 +18,6 @@ $(eval $(call gb_Library_add_cxxflags,regactivex,\
))
$(eval $(call gb_Library_add_ldflags,regactivex,\
/DEF:$(SRCDIR)/setup_native/source/win32/customactions/regactivex/regactivex.def \
/NODEFAULTLIB \
))
......
......@@ -18,7 +18,6 @@ $(eval $(call gb_Library_add_cxxflags,sdqsmsi,\
))
$(eval $(call gb_Library_add_ldflags,sdqsmsi,\
/DEF:$(SRCDIR)/setup_native/source/win32/customactions/quickstarter/sdqsmsi.def \
/NODEFAULTLIB \
))
......
......@@ -22,7 +22,6 @@ $(eval $(call gb_Library_add_cxxflags,sellangmsi,\
))
$(eval $(call gb_Library_add_ldflags,sellangmsi,\
/DEF:$(SRCDIR)/setup_native/source/win32/customactions/sellang/sellang.def \
/NODEFAULTLIB \
))
......
......@@ -22,7 +22,6 @@ $(eval $(call gb_Library_add_cxxflags,shlxtmsi,\
))
$(eval $(call gb_Library_add_ldflags,shlxtmsi,\
/DEF:$(SRCDIR)/setup_native/source/win32/customactions/shellextensions/shlxtmsi.def \
/NODEFAULTLIB \
))
......
......@@ -18,7 +18,6 @@ $(eval $(call gb_Library_add_cxxflags,sn_tools,\
))
$(eval $(call gb_Library_add_ldflags,sn_tools,\
/DEF:$(SRCDIR)/setup_native/source/win32/customactions/tools/sn_tools.def \
/NODEFAULTLIB \
))
......
LIBRARY "instooofiltmsi.dll"
EXPORTS
RestartIndexingService
\ No newline at end of file
......@@ -124,7 +124,7 @@ void StartIndexingService(SC_HANDLE hService)
}
}
extern "C" UINT __stdcall RestartIndexingService(MSIHANDLE)
extern "C" __declspec(dllexport) UINT __stdcall RestartIndexingService(MSIHANDLE)
{
SC_HANDLE hSCManager = OpenSCManagerW(
nullptr, // local machine
......
......@@ -326,7 +326,7 @@ private:
// "InstMSUBinary" property and unpacks the binary with that name to a temporary file; sets
// "cleanup_msu" and "inst_msu" properties to the full name of the extracted temporary file. These
// properties will become "CustomActionData" property inside relevant deferred actions.
extern "C" UINT __stdcall UnpackMSUForInstall(MSIHANDLE hInstall)
extern "C" __declspec(dllexport) UINT __stdcall UnpackMSUForInstall(MSIHANDLE hInstall)
{
try
{
......@@ -411,7 +411,7 @@ extern "C" UINT __stdcall UnpackMSUForInstall(MSIHANDLE hInstall)
// Deferred action "inst_msu" that must be run from system account. Receives the tempfile name from
// "CustomActionData" property, and runs wusa.exe to install it. Waits for it and checks exit code.
extern "C" UINT __stdcall InstallMSU(MSIHANDLE hInstall)
extern "C" __declspec(dllexport) UINT __stdcall InstallMSU(MSIHANDLE hInstall)
{
try
{
......@@ -486,7 +486,7 @@ extern "C" UINT __stdcall InstallMSU(MSIHANDLE hInstall)
// Rollback deferred action "cleanup_msu" that is executed on error or cancel.
// It removes the temporary file created by UnpackMSUForInstall action.
// MUST be placed IMMEDIATELY AFTER "unpack_msu" in execute sequence.
extern "C" UINT __stdcall CleanupMSU(MSIHANDLE hInstall)
extern "C" __declspec(dllexport) UINT __stdcall CleanupMSU(MSIHANDLE hInstall)
{
try
{
......
LIBRARY "inst_msu_msi.dll"
EXPORTS
UnpackMSUForInstall
InstallMSU
CleanupMSU
\ No newline at end of file
LIBRARY "qslnkmsi.dll"
EXPORTS
RemoveQuickstarterLink
\ No newline at end of file
......@@ -21,7 +21,7 @@
#include <shlobj.h>
extern "C" UINT __stdcall RemoveQuickstarterLink( MSIHANDLE hMSI )
extern "C" __declspec(dllexport) UINT __stdcall RemoveQuickstarterLink( MSIHANDLE hMSI )
{
WCHAR szStartupPath[MAX_PATH];
......
LIBRARY "sdqsmsi.dll"
EXPORTS
ShutDownQuickstarter
\ No newline at end of file
......@@ -63,7 +63,7 @@ static BOOL CALLBACK EnumWindowsProc( HWND hWnd, LPARAM lParam )
}
extern "C" UINT __stdcall ShutDownQuickstarter( MSIHANDLE hMSI )
extern "C" __declspec(dllexport) UINT __stdcall ShutDownQuickstarter( MSIHANDLE hMSI )
{
EnumWindows( EnumWindowsProc, hMSI );
......
LIBRARY "reg4allmsdoc.dll"
EXPORTS
FindRegisteredExtensions
LookForRegisteredExtensions
RegisterSomeExtensions
RestoreRegAllMSDoc
\ No newline at end of file
......@@ -257,7 +257,7 @@ static void registerSomeExtensions( MSIHANDLE handle, const int nStart, const in
}
}
extern "C" UINT __stdcall LookForRegisteredExtensions( MSIHANDLE handle )
extern "C" __declspec(dllexport) UINT __stdcall LookForRegisteredExtensions( MSIHANDLE handle )
{
OutputDebugStringFormatW( L"LookForRegisteredExtensions: " );
......@@ -358,7 +358,7 @@ extern "C" UINT __stdcall LookForRegisteredExtensions( MSIHANDLE handle )
return ERROR_SUCCESS;
}
extern "C" UINT __stdcall RegisterSomeExtensions( MSIHANDLE handle )
extern "C" __declspec(dllexport) UINT __stdcall RegisterSomeExtensions( MSIHANDLE handle )
{
OutputDebugStringFormatW( L"RegisterSomeExtensions: " );
......@@ -412,7 +412,7 @@ extern "C" UINT __stdcall RegisterSomeExtensions( MSIHANDLE handle )
return ERROR_SUCCESS;
}
extern "C" UINT __stdcall FindRegisteredExtensions( MSIHANDLE handle )
extern "C" __declspec(dllexport) UINT __stdcall FindRegisteredExtensions( MSIHANDLE handle )
{
if ( IsSetMsiPropW( handle, L"FILETYPEDIALOGUSED" ) )
{
......@@ -501,7 +501,7 @@ static void restoreOldRegistration( LPCWSTR lpSubKey )
}
}
extern "C" UINT __stdcall RestoreRegAllMSDoc( MSIHANDLE /*handle*/ )
extern "C" __declspec(dllexport) UINT __stdcall RestoreRegAllMSDoc( MSIHANDLE /*handle*/ )
{
OutputDebugStringFormatW( L"RestoreRegAllMSDoc\n" );
......
......@@ -259,7 +259,7 @@ BOOL MakeInstallFor64Bit( MSIHANDLE hMSI )
return bResult;
}
extern "C" UINT __stdcall InstallActiveXControl( MSIHANDLE hMSI )
extern "C" __declspec(dllexport) UINT __stdcall InstallActiveXControl( MSIHANDLE hMSI )
{
INSTALLSTATE current_state;
INSTALLSTATE future_state;
......@@ -306,7 +306,7 @@ extern "C" UINT __stdcall InstallActiveXControl( MSIHANDLE hMSI )
}
extern "C" UINT __stdcall DeinstallActiveXControl( MSIHANDLE hMSI )
extern "C" __declspec(dllexport) UINT __stdcall DeinstallActiveXControl( MSIHANDLE hMSI )
{
INSTALLSTATE current_state;
INSTALLSTATE future_state;
......
LIBRARY "regactivex.dll"
EXPORTS
InstallActiveXControl
DeinstallActiveXControl
\ No newline at end of file
......@@ -231,7 +231,7 @@ void addMatchingDictionaries(
}
extern "C" UINT __stdcall SelectLanguage( MSIHANDLE handle )
extern "C" __declspec(dllexport) UINT __stdcall SelectLanguage( MSIHANDLE handle )
{
char feature[100];
MSIHANDLE database, view, record;
......
LIBRARY "sellangmsi.dll"
EXPORTS
SelectLanguage
SortTree
\ No newline at end of file
......@@ -12,7 +12,7 @@
#include <msi.h>
#include <commctrl.h>
extern "C" UINT __stdcall SortTree(MSIHANDLE)
extern "C" __declspec(dllexport) UINT __stdcall SortTree(MSIHANDLE)
{
// Sort items (languages) in SelectionTree control, fdo#46355
......
......@@ -28,7 +28,7 @@
#include <systools/win32/uwinapi.h>
#include "../tools/seterror.hxx"
extern "C" UINT __stdcall CheckInstallDirectory(MSIHANDLE handle)
extern "C" __declspec(dllexport) UINT __stdcall CheckInstallDirectory(MSIHANDLE handle)
{
std::wstring sInstallPath = GetMsiPropertyW(handle, L"INSTALLLOCATION");
std::wstring sOfficeHostnamePath = GetMsiPropertyW(handle, L"OFFICEDIRHOSTNAME");
......
......@@ -38,7 +38,7 @@ static inline void OutputDebugStringFormatW( PCWSTR, ... )
}
#endif
extern "C" UINT __stdcall CheckPatchList( MSIHANDLE handle )
extern "C" __declspec(dllexport) UINT __stdcall CheckPatchList( MSIHANDLE handle )
{
std::wstring sPatchList = GetMsiPropertyW( handle, L"PATCH" );
std::wstring sRequiredPatch = GetMsiPropertyW( handle, L"PREREQUIREDPATCH" );
......
......@@ -21,7 +21,7 @@
#include <malloc.h>
extern "C" UINT __stdcall CompleteInstallPath( MSIHANDLE handle )
extern "C" __declspec(dllexport) UINT __stdcall CompleteInstallPath( MSIHANDLE handle )
{
// This CustomAction is necessary for updates from OOo 3.0, OOo 3.1 and OOo 3.2 to versions
// OOo 3.3 or later. This is caused by a change of INSTALLLOCATION, that starting with OOo 3.3
......
......@@ -21,7 +21,7 @@
#include <algorithm>
#include <systools/win32/uwinapi.h>
extern "C" UINT __stdcall MigrateInstallPath( MSIHANDLE handle )
extern "C" __declspec(dllexport) UINT __stdcall MigrateInstallPath( MSIHANDLE handle )
{
WCHAR szValue[8192];
DWORD nValueSize = sizeof(szValue); // yes, it is the number of bytes
......
LIBRARY "shlxtmsi.dll"
EXPORTS
CheckInstallDirectory
CheckPatchList
CompleteInstallPath
MigrateInstallPath
InstallStartmenuFolderIcon
DeinstallStartmenuFolderIcon
SetProductInstallMode
RenamePrgFolder
RemovePrgFolder
......@@ -25,7 +25,7 @@
Called during installation to customize the start menu folder icon.
See: http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_extending/custom.asp
*/
extern "C" UINT __stdcall InstallStartmenuFolderIcon( MSIHANDLE handle )
extern "C" __declspec(dllexport) UINT __stdcall InstallStartmenuFolderIcon( MSIHANDLE handle )
{
std::wstring sOfficeMenuFolder = GetMsiPropertyW( handle, L"OfficeMenuFolder" );
std::wstring sDesktopFile = sOfficeMenuFolder + L"Desktop.ini";
......@@ -47,7 +47,7 @@ extern "C" UINT __stdcall InstallStartmenuFolderIcon( MSIHANDLE handle )
return ERROR_SUCCESS;
}
extern "C" UINT __stdcall DeinstallStartmenuFolderIcon(MSIHANDLE handle)
extern "C" __declspec(dllexport) UINT __stdcall DeinstallStartmenuFolderIcon(MSIHANDLE handle)
{
std::wstring sOfficeMenuFolder = GetMsiPropertyW( handle, L"OfficeMenuFolder" );
std::wstring sDesktopFile = sOfficeMenuFolder + L"Desktop.ini";
......
......@@ -129,7 +129,7 @@ namespace
}
} // namespace
extern "C" UINT __stdcall SetProductInstallMode(MSIHANDLE handle)
extern "C" __declspec(dllexport) UINT __stdcall SetProductInstallMode(MSIHANDLE handle)
{
std::wstring upgradeCode = GetMsiPropertyW(handle, L"UpgradeCode");
upgradeCode = ConvertGuid(std::wstring(upgradeCode.c_str() + 1, upgradeCode.length() - 2));
......
......@@ -80,7 +80,7 @@ static BOOL RemoveCompleteDirectoryW(const std::wstring& rPath)
return bDirectoryRemoved;
}
extern "C" UINT __stdcall RenamePrgFolder( MSIHANDLE handle )
extern "C" __declspec(dllexport) UINT __stdcall RenamePrgFolder( MSIHANDLE handle )
{
std::wstring sOfficeInstallPath = GetMsiPropertyW(handle, L"INSTALLLOCATION");
......@@ -105,7 +105,7 @@ extern "C" UINT __stdcall RenamePrgFolder( MSIHANDLE handle )
return ERROR_SUCCESS;
}
extern "C" UINT __stdcall RemovePrgFolder( MSIHANDLE handle )
extern "C" __declspec(dllexport) UINT __stdcall RemovePrgFolder( MSIHANDLE handle )
{
std::wstring sOfficeInstallPath = GetMsiPropertyW(handle, L"INSTALLLOCATION");
std::wstring sRemoveDir = sOfficeInstallPath + L"program_old";
......
......@@ -66,7 +66,7 @@ static inline void OutputDebugStringFormatW( PCWSTR, ... )
#endif
extern "C" UINT __stdcall CheckVersions( MSIHANDLE hMSI )
extern "C" __declspec(dllexport) UINT __stdcall CheckVersions( MSIHANDLE hMSI )
{
// MessageBoxW(NULL, L"CheckVersions", L"Information", MB_OK | MB_ICONINFORMATION);
......
LIBRARY "sn_tools.dll"
EXPORTS
CheckVersions
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment