Bug 1022847 - toolkit/mozapps/update fails to compile with MinGW r=netzen

--HG--
extra : rebase_source : d876570cbfb29bc86cf1435f8e0f79eda49b5764
This commit is contained in:
Jacek Caban 2014-06-25 11:30:05 +02:00
parent 9039763d46
commit dd423b2558
6 changed files with 10 additions and 6 deletions

View File

@ -10,7 +10,6 @@
#define _WIN32_WINNT 0x602
#include <objbase.h>
#include <shobjidl.h>
#pragma comment(lib, "ole32.lib")
#endif
#include <windows.h>
@ -28,7 +27,6 @@
// Needed for PathAppendW
#include <shlwapi.h>
#pragma comment(lib, "shlwapi.lib")
WCHAR* MakeCommandLine(int argc, WCHAR **argv);
BOOL PathAppendSafe(LPWSTR base, LPCWSTR extra);

View File

@ -69,6 +69,7 @@ MOZ_WINCONSOLE = 1
ifeq ($(OS_ARCH),WINNT)
LIBS += $(call EXPAND_LIBNAME_PATH,updatecommon-standalone,../common-standalone)
OS_LIBS += $(call EXPAND_LIBNAME,wintrust shlwapi)
else
LIBS += $(call EXPAND_LIBNAME_PATH,updatecommon,../common)
endif

View File

@ -3,8 +3,6 @@
*/
#ifdef XP_WIN
#pragma comment(lib, "wintrust.lib")
#pragma comment(lib, "crypt32.lib")
# include <windows.h>
# include <wintrust.h>
# include <tlhelp32.h>

View File

@ -43,3 +43,5 @@ if CONFIG['OS_ARCH'] == 'WINNT':
DEFINES['UNICODE'] = True
DEFINES['_UNICODE'] = True
USE_STATIC_LIBS = True
if CONFIG['GNU_CC']:
WIN32_EXE_LDFLAGS += ['-municode']

View File

@ -23,6 +23,7 @@ if CONFIG['OS_ARCH'] == 'WINNT':
RCINCLUDE = 'updater.rc'
DEFINES['UNICODE'] = True
DEFINES['_UNICODE'] = True
DEFINES['NOMINMAX'] = True
USE_STATIC_LIBS = True
# Pick up nsWindowsRestart.cpp
@ -57,6 +58,7 @@ if have_progressui == 0:
]
DEFINES['NS_NO_XPCOM'] = True
DISABLE_STL_WRAPPING = True
for var in ('MAR_CHANNEL_ID', 'MOZ_APP_VERSION'):
DEFINES[var] = '"%s"' % CONFIG[var]
@ -73,6 +75,8 @@ DELAYLOAD_DLLS += [
if CONFIG['_MSC_VER']:
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
elif CONFIG['OS_ARCH'] == 'WINNT':
WIN32_EXE_LDFLAGS += ['-municode']
if CONFIG['MOZ_UPDATE_CHANNEL'] in ('beta', 'release', 'esr'):
DEFINES['MAR_SIGNING_RELEASE_BETA'] = '1'

View File

@ -50,6 +50,7 @@
#include <fcntl.h>
#include <limits.h>
#include <errno.h>
#include <algorithm>
#include "updatelogging.h"
@ -2668,7 +2669,7 @@ int NS_main(int argc, NS_tchar **argv)
return 1;
}
char16_t *cmdLine = MakeCommandLine(argc - 1, argv + 1);
wchar_t *cmdLine = MakeCommandLine(argc - 1, argv + 1);
if (!cmdLine) {
CloseHandle(elevatedFileHandle);
return 1;
@ -2985,7 +2986,7 @@ int NS_main(int argc, NS_tchar **argv)
size_t callbackPrefixLength = PathCommonPrefixW(argv[callbackIndex],
installDir,
nullptr);
NS_tstrncpy(p, argv[callbackIndex] + max(callbackPrefixLength, commonPrefixLength), bufferLeft);
NS_tstrncpy(p, argv[callbackIndex] + std::max(callbackPrefixLength, commonPrefixLength), bufferLeft);
targetPath = buffer;
}
if (!GetLongPathNameW(targetPath, callbackLongPath,