diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-11-16 15:30:26 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-11-17 00:45:12 +0100 |
commit | 8e5ea6dcbf80d2969f15cd947933f672c405ddb5 (patch) | |
tree | 8a31a93bd01e01b641a355af76bcd9a6d5658d1d | |
parent | e60f936ecede4dc97a41b9d278c038c638c5770a (diff) |
pyuno: fix breakage because PATH_MAX not defined with Python3
Change-Id: I12e55c8810193591d9cd017bf5d89078b3915ddb
-rw-r--r-- | pyuno/source/loader/pyuno_loader.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/pyuno/source/loader/pyuno_loader.cxx b/pyuno/source/loader/pyuno_loader.cxx index 3e7a250d687a..329a1c7f4c35 100644 --- a/pyuno/source/loader/pyuno_loader.cxx +++ b/pyuno/source/loader/pyuno_loader.cxx @@ -30,6 +30,19 @@ #include <cppuhelper/implementationentry.hxx> #include <cppuhelper/factory.hxx> +// apparently PATH_MAX is not standard and not defined by MSVC +#ifndef PATH_MAX +#ifdef _MAX_PATH +#define PATH_MAX _MAX_PATH +#else +#ifdef MAX_PATH +#define PATH_MAX MAX_PATH +#else +#error no PATH_MAX +#endif +#endif +#endif + using rtl::OUString; using rtl::OUStringBuffer; using rtl::OString; @@ -111,7 +124,6 @@ static void setPythonHome ( const OUString & pythonHome ) OString o = rtl::OUStringToOString( systemPythonHome, osl_getThreadTextEncoding() ); #if PY_MAJOR_VERSION >= 3 // static because Py_SetPythonHome just copies the "wide" pointer - // PATH_MAX is defined in Python.h static wchar_t wide[PATH_MAX + 1]; size_t len = mbstowcs(wide, o.pData->buffer, PATH_MAX + 1); if(len == (size_t)-1) |