Bug 969918 - Use decltype to declare pointers for dynamic-loaded functions. r=jimm sr=roc

This commit is contained in:
Masatoshi Kimura
2014-02-18 07:32:52 +09:00
parent 68e6c3c4ee
commit 5bbacee4ff
24 changed files with 114 additions and 513 deletions

View File

@@ -606,9 +606,6 @@ nsWindowsShellService::GetCanSetDesktopBackground(bool* aResult)
static nsresult
DynSHOpenWithDialog(HWND hwndParent, const OPENASINFO *poainfo)
{
typedef HRESULT (WINAPI * SHOpenWithDialogPtr)(HWND hwndParent,
const OPENASINFO *poainfo);
// shell32.dll is in the knownDLLs list so will always be loaded from the
// system32 directory.
static const wchar_t kSehllLibraryName[] = L"shell32.dll";
@@ -617,8 +614,8 @@ DynSHOpenWithDialog(HWND hwndParent, const OPENASINFO *poainfo)
return NS_ERROR_FAILURE;
}
SHOpenWithDialogPtr SHOpenWithDialogFn =
(SHOpenWithDialogPtr)GetProcAddress(shellDLL, "SHOpenWithDialog");
decltype(SHOpenWithDialog)* SHOpenWithDialogFn =
(decltype(SHOpenWithDialog)*) GetProcAddress(shellDLL, "SHOpenWithDialog");
if (!SHOpenWithDialogFn) {
return NS_ERROR_FAILURE;