From 8e5ea6dcbf80d2969f15cd947933f672c405ddb5 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 16 Nov 2012 15:30:26 +0100 Subject: pyuno: fix breakage because PATH_MAX not defined with Python3 Change-Id: I12e55c8810193591d9cd017bf5d89078b3915ddb --- pyuno/source/loader/pyuno_loader.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'pyuno') 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 #include +// 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) -- cgit