mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 792625: Fix xpcshell to accept non-ASCII command line arguments on Windows. r=bsmedberg
This commit is contained in:
parent
53271e4c0c
commit
03cf2b648a
@ -16,6 +16,10 @@ SDK_BINARY = $(PROGRAM)
|
|||||||
|
|
||||||
CPPSRCS = xpcshell.cpp
|
CPPSRCS = xpcshell.cpp
|
||||||
|
|
||||||
|
LOCAL_INCLUDES += \
|
||||||
|
-I$(topsrcdir)/toolkit/xre \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
|
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
|
||||||
CMMSRCS += xpcshellMacUtils.mm
|
CMMSRCS += xpcshellMacUtils.mm
|
||||||
endif
|
endif
|
||||||
@ -63,6 +67,13 @@ ifeq ($(OS_TEST),ia64)
|
|||||||
LIBS += $(JEMALLOC_LIBS)
|
LIBS += $(JEMALLOC_LIBS)
|
||||||
endif
|
endif
|
||||||
include $(topsrcdir)/config/config.mk
|
include $(topsrcdir)/config/config.mk
|
||||||
|
|
||||||
|
ifdef _MSC_VER
|
||||||
|
# Always enter a Windows program through wmain, whether or not we're
|
||||||
|
# a console application.
|
||||||
|
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
|
||||||
|
endif
|
||||||
|
|
||||||
include $(topsrcdir)/ipc/chromium/chromium-config.mk
|
include $(topsrcdir)/ipc/chromium/chromium-config.mk
|
||||||
include $(topsrcdir)/config/rules.mk
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
|
@ -51,6 +51,13 @@
|
|||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <shlobj.h>
|
#include <shlobj.h>
|
||||||
|
|
||||||
|
// we want a wmain entry point
|
||||||
|
#define XRE_DONT_PROTECT_DLL_LOAD
|
||||||
|
#define XRE_WANT_ENVIRON
|
||||||
|
#include "nsWindowsWMain.cpp"
|
||||||
|
#define snprintf _snprintf
|
||||||
|
#define strcasecmp _stricmp
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
|
@ -42,7 +42,11 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
#define main NS_internal_main
|
#define main NS_internal_main
|
||||||
|
|
||||||
|
#ifndef XRE_WANT_ENVIRON
|
||||||
int main(int argc, char **argv);
|
int main(int argc, char **argv);
|
||||||
|
#else
|
||||||
|
int main(int argc, char **argv, char **envp);
|
||||||
|
#endif
|
||||||
|
|
||||||
static char*
|
static char*
|
||||||
AllocConvertUTF16toUTF8(const WCHAR *arg)
|
AllocConvertUTF16toUTF8(const WCHAR *arg)
|
||||||
@ -97,7 +101,13 @@ int wmain(int argc, WCHAR **argv)
|
|||||||
}
|
}
|
||||||
for (int i = 0; i < argc; i++)
|
for (int i = 0; i < argc; i++)
|
||||||
deleteUs[i] = argvConverted[i];
|
deleteUs[i] = argvConverted[i];
|
||||||
|
#ifndef XRE_WANT_ENVIRON
|
||||||
int result = main(argc, argvConverted);
|
int result = main(argc, argvConverted);
|
||||||
|
#else
|
||||||
|
// Force creation of the multibyte _environ variable.
|
||||||
|
getenv("PATH");
|
||||||
|
int result = main(argc, argvConverted, _environ);
|
||||||
|
#endif
|
||||||
|
|
||||||
delete[] argvConverted;
|
delete[] argvConverted;
|
||||||
FreeAllocStrings(argc, deleteUs);
|
FreeAllocStrings(argc, deleteUs);
|
||||||
|
Loading…
Reference in New Issue
Block a user