mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
python: Enable C compiler warnings.
This commit is contained in:
@@ -35,6 +35,12 @@ let rec generate_python_c () =
|
||||
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 <Python.h>
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -567,12 +573,16 @@ moduleinit (void)
|
||||
}
|
||||
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
extern PyMODINIT_FUNC PyInit_libguestfsmod (void);
|
||||
|
||||
PyMODINIT_FUNC
|
||||
PyInit_libguestfsmod (void)
|
||||
{
|
||||
return moduleinit ();
|
||||
}
|
||||
#else
|
||||
extern void initlibguestfsmod (void);
|
||||
|
||||
void
|
||||
initlibguestfsmod (void)
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ python_LTLIBRARIES = libguestfsmod.la
|
||||
libguestfsmod_la_SOURCES = guestfs-py.c guestfs-py.h guestfs-py-byhand.c
|
||||
libguestfsmod_la_CFLAGS = \
|
||||
-DGUESTFS_PRIVATE_FUNCTIONS=1 \
|
||||
-Wall \
|
||||
$(WARN_CFLAGS) $(WERROR_CFLAGS) \
|
||||
-I$(PYTHON_INCLUDEDIR) \
|
||||
-I$(top_srcdir)/src -I$(top_builddir)/src
|
||||
libguestfsmod_la_LIBADD = $(top_builddir)/src/libguestfs.la
|
||||
|
||||
@@ -21,6 +21,12 @@
|
||||
* guestfs-py.c).
|
||||
*/
|
||||
|
||||
/* This has to be included first, else definitions conflict with
|
||||
* glibc header files. Python is broken.
|
||||
*/
|
||||
#define PY_SSIZE_T_CLEAN 1
|
||||
#include <Python.h>
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -21,9 +21,6 @@
|
||||
|
||||
#include "guestfs.h"
|
||||
|
||||
#define PY_SSIZE_T_CLEAN 1
|
||||
#include <Python.h>
|
||||
|
||||
#if PY_VERSION_HEX < 0x02050000
|
||||
typedef int Py_ssize_t;
|
||||
#define PY_SSIZE_T_MAX INT_MAX
|
||||
|
||||
Reference in New Issue
Block a user