summaryrefslogtreecommitdiff
path: root/pyuno/zipcore
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-02-10 14:05:21 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-02-10 18:01:27 +0000
commit8646ab97dc37c0606b19057686bf3d610f9c15ee (patch)
tree17b3df6f5cf55cb1091c4aa70930dd415d9ea0e3 /pyuno/zipcore
parent09e9274fc080b471393b806617eb03124db67590 (diff)
Remove MinGW support
In OOo times, there'd originally been efforts to allow building on Windows with MinGW. Later, in LO times, this has been shifted to an attempt of cross- compiling for Windows on Linux. That attempt can be considered abandoned, and the relevant code rotting. Due to this heritage, there are now three kinds of MinGW-specific code in LO: * Code from the original OOo native Windows effort that is no longer relevant for the LO cross-compilation effort, but has never been removed properly. * Code from the original OOo native Windows effort that is re-purposed for the LO cross-compilation effort. * Code that has been added specifially for the LO cross-compilation effort. All three kinds of code are removed. (An unrelated, remaining use of MinGW is for --enable-build-unowinreg, utilizing --with-mingw-cross-compiler, MINGWCXX, and MINGWSTRIP.) Change-Id: I49daad8669b4cbe49fa923050c4a4a6ff7dda568 Reviewed-on: https://gerrit.libreoffice.org/34127 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'pyuno/zipcore')
-rw-r--r--pyuno/zipcore/python.cxx45
1 files changed, 2 insertions, 43 deletions
diff --git a/pyuno/zipcore/python.cxx b/pyuno/zipcore/python.cxx
index b67b17f28f4f..c128938cbc8f 100644
--- a/pyuno/zipcore/python.cxx
+++ b/pyuno/zipcore/python.cxx
@@ -24,13 +24,9 @@
#include <wchar.h>
#define WIN32_LEAN_AND_MEAN
-#if defined _MSC_VER
#pragma warning(push, 1)
-#endif
#include <windows.h>
-#if defined _MSC_VER
#pragma warning(pop)
-#endif
#include "tools/pathutils.hxx"
@@ -69,11 +65,7 @@ wchar_t * encode(wchar_t * buffer, wchar_t const * text) {
return buffer;
}
-#ifdef __MINGW32__
-int main(int argc, char ** argv, char **) {
-#else
int wmain(int argc, wchar_t ** argv, wchar_t **) {
-#endif
wchar_t path[MAX_PATH];
DWORD n = GetModuleFileNameW(nullptr, path, MAX_PATH);
if (n == 0 || n >= MAX_PATH) {
@@ -111,15 +103,6 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
if (pythonpath3End == nullptr) {
exit(EXIT_FAILURE);
}
-#ifdef __MINGW32__
- wchar_t pythonpath4[MAX_PATH];
- wchar_t * pythonpath4End = tools::buildPath(
- pythonpath4, path, pathEnd,
- MY_STRING(L"\\python-core-" PYTHON_VERSION_STRING L"\\lib\\lib-dynload"));
- if (pythonpath4End == NULL) {
- exit(EXIT_FAILURE);
- }
-#endif
wchar_t pythonhome[MAX_PATH];
wchar_t * pythonhomeEnd = tools::buildPath(
pythonhome, path, pathEnd, MY_STRING(L"\\python-core-" PYTHON_VERSION_STRING));
@@ -138,27 +121,14 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
// 4 * len: each char preceded by backslash, each trailing backslash
// doubled
for (int i = 1; i < argc; ++i) {
-#ifdef __MINGW32__
- clSize += MY_LENGTH(L" \"") + 4 * strlen(argv[i]) +
-#else
- clSize += MY_LENGTH(L" \"") + 4 * wcslen(argv[i]) +
-#endif
- MY_LENGTH(L"\""); //TODO: overflow
+ clSize += MY_LENGTH(L" \"") + 4 * wcslen(argv[i]) + MY_LENGTH(L"\"");
+ //TODO: overflow
}
wchar_t * cl = new wchar_t[clSize];
wchar_t * cp = encode(cl, pythonhome);
for (int i = 1; i < argc; ++i) {
*cp++ = L' ';
-#ifdef __MINGW32__
- int nNeededWStrBuffSize = MultiByteToWideChar(CP_ACP, 0, argv[i], -1, NULL, 0);
- WCHAR *buff = new WCHAR[nNeededWStrBuffSize+1];
- MultiByteToWideChar(CP_ACP, 0, argv[i], -1, buff, nNeededWStrBuffSize);
- buff[nNeededWStrBuffSize] = 0;
- cp = encode(cp, buff);
- delete [] buff;
-#else
cp = encode(cp, argv[i]);
-#endif
}
*cp = L'\0';
n = GetEnvironmentVariableW(L"PATH", nullptr, 0);
@@ -201,16 +171,6 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
exit(EXIT_FAILURE);
}
}
-#ifdef __MINGW32__
- len = (pathEnd - path) + MY_LENGTH(L";") + (pythonpath2End - pythonpath2) +
- MY_LENGTH(L";") + (pythonpath4End - pythonpath4) +
- MY_LENGTH(L";") + (pythonpath3End - pythonpath3) +
- (n == 0 ? 0 : MY_LENGTH(L";") + (n - 1)) + 1; //TODO: overflow
- value = new wchar_t[len];
- _snwprintf(
- value, len, L"%s;%s;%s;%s%s%s", path, pythonpath2, pythonpath4,
- pythonpath3, n == 0 ? L"" : L";", orig);
-#else
len = (pathEnd - path) + MY_LENGTH(L";") + (pythonpath2End - pythonpath2) +
MY_LENGTH(L";") + (pythonpath3End - pythonpath3) +
(n == 0 ? 0 : MY_LENGTH(L";") + (n - 1)) + 1; //TODO: overflow
@@ -218,7 +178,6 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
_snwprintf(
value, len, L"%s;%s;%s%s%s", path, pythonpath2, pythonpath3,
n == 0 ? L"" : L";", orig);
-#endif
if (!SetEnvironmentVariableW(L"PYTHONPATH", value)) {
exit(EXIT_FAILURE);
}