diff --git a/generator/python.ml b/generator/python.ml index 74acf5de8..ccf684693 100644 --- a/generator/python.ml +++ b/generator/python.ml @@ -44,6 +44,9 @@ let rec generate_python_actions_h () = #include \"guestfs.h\" #include \"guestfs-utils.h\" +#define PY_SSIZE_T_CLEAN 1 +#include + #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX @@ -134,12 +137,6 @@ and generate_python_structs () = generate_header CStyle LGPLv2plus; pr "\ -/* This has to be included first, else definitions conflict with - * glibc header files. Python is broken. - */ -#define PY_SSIZE_T_CLEAN 1 -#include - #include #include @@ -272,12 +269,6 @@ and generate_python_actions actions () = generate_header CStyle LGPLv2plus; pr "\ -/* This has to be included first, else definitions conflict with - * glibc header files. Python is broken. - */ -#define PY_SSIZE_T_CLEAN 1 -#include - #include /* It is safe to call deprecated functions from this file. */ @@ -569,12 +560,6 @@ and generate_python_module () = generate_header CStyle LGPLv2plus; pr "\ -/* This has to be included first, else definitions conflict with - * glibc header files. Python is broken. - */ -#define PY_SSIZE_T_CLEAN 1 -#include - #include #include diff --git a/python/handle.c b/python/handle.c index adba1b823..ffd0794d8 100644 --- a/python/handle.c +++ b/python/handle.c @@ -22,12 +22,6 @@ * F). */ -/* This has to be included first, else definitions conflict with - * glibc header files. Python is broken. - */ -#define PY_SSIZE_T_CLEAN 1 -#include - #include #include