Explorar o código

HPCC-17532 Build Windows Client with Pyembed

Hack to workaround ssize_t redefinition

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman %!s(int64=8) %!d(string=hai) anos
pai
achega
e107377f9d
Modificáronse 2 ficheiros con 18 adicións e 0 borrados
  1. 9 0
      plugins/py3embed/py3embed.cpp
  2. 9 0
      plugins/pyembed/pyembed.cpp

+ 9 - 0
plugins/py3embed/py3embed.cpp

@@ -16,7 +16,16 @@
 ############################################################################## */
 
 #include "platform.h"
+
+#ifdef _WIN32
+// There's an issue with Python redefining ssize_t resulting in errors - hide their definition
+#define ssize_t python_ssize_t
+#include "Python.h"
+#undef ssize_t
+#else
 #include "Python.h"
+#endif
+
 #include "frameobject.h"
 #include "jexcept.hpp"
 #include "jutil.hpp"

+ 9 - 0
plugins/pyembed/pyembed.cpp

@@ -16,7 +16,16 @@
 ############################################################################## */
 
 #include "platform.h"
+
+#ifdef _WIN32
+// There's an issue with Python redefining ssize_t resulting in errors - hide their definition
+#define ssize_t python_ssize_t
+#include "Python.h"
+#undef ssize_t
+#else
 #include "Python.h"
+#endif
+
 #include "frameobject.h"
 #include "jexcept.hpp"
 #include "jthread.hpp"