Pārlūkot izejas kodu

HPCC-17532 Build Windows Client with Pyembed

Hack to workaround ssize_t redefinition

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 8 gadi atpakaļ
vecāks
revīzija
e107377f9d
2 mainītis faili ar 18 papildinājumiem un 0 dzēšanām
  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"