From 3050f8328862c7c77d3d692453bd9cc0885824e5 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 23 Oct 2009 16:23:01 +1100 Subject: [PATCH] s4-python: we need to include Python.h first If we don't include Python.h first then we get a pile of warnings due to broken redefines of XOPEN_SOURCE in the Python includes. --- libcli/nbt/pynbt.c | 2 +- source4/auth/credentials/pycredentials.c | 2 +- source4/auth/gensec/pygensec.c | 2 +- source4/lib/com/pycom.c | 2 +- source4/lib/ldb/pyldb.c | 2 +- source4/lib/messaging/pymessaging.c | 2 +- source4/lib/registry/pyregistry.c | 2 +- source4/libnet/py_net.c | 2 +- source4/librpc/rpc/pyrpc.c | 2 +- source4/param/provision.c | 2 +- source4/param/pyparam.c | 5 +---- source4/param/pyparam_util.c | 5 +---- source4/scripting/python/modules.c | 2 +- source4/scripting/python/pyglue.c | 2 +- source4/scripting/python/uuidmodule.c | 2 +- source4/web_server/wsgi.c | 2 +- 16 files changed, 16 insertions(+), 22 deletions(-) diff --git a/libcli/nbt/pynbt.c b/libcli/nbt/pynbt.c index 9be6c79a8b2..425ad13c6dd 100644 --- a/libcli/nbt/pynbt.c +++ b/libcli/nbt/pynbt.c @@ -17,8 +17,8 @@ along with this program. If not, see . */ -#include "includes.h" #include +#include "includes.h" #include "libcli/util/pyerrors.h" #include "scripting/python/modules.h" #include "../libcli/nbt/libnbt.h" diff --git a/source4/auth/credentials/pycredentials.c b/source4/auth/credentials/pycredentials.c index b0433abeab1..59a200b09e1 100644 --- a/source4/auth/credentials/pycredentials.c +++ b/source4/auth/credentials/pycredentials.c @@ -16,8 +16,8 @@ along with this program. If not, see . */ -#include "includes.h" #include +#include "includes.h" #include "pycredentials.h" #include "param/param.h" #include "lib/cmdline/credentials.h" diff --git a/source4/auth/gensec/pygensec.c b/source4/auth/gensec/pygensec.c index c799ffd75c6..87c38053a74 100644 --- a/source4/auth/gensec/pygensec.c +++ b/source4/auth/gensec/pygensec.c @@ -16,8 +16,8 @@ along with this program. If not, see . */ -#include "includes.h" #include +#include "includes.h" #include "param/pyparam.h" #include "auth/gensec/gensec.h" #include "libcli/util/pyerrors.h" diff --git a/source4/lib/com/pycom.c b/source4/lib/com/pycom.c index d5a07580ea1..86e794e1732 100644 --- a/source4/lib/com/pycom.c +++ b/source4/lib/com/pycom.c @@ -17,8 +17,8 @@ along with this program. If not, see . */ -#include "includes.h" #include +#include "includes.h" #include "lib/com/com.h" #include "librpc/ndr/libndr.h" #include "libcli/util/pyerrors.h" diff --git a/source4/lib/ldb/pyldb.c b/source4/lib/ldb/pyldb.c index 35508c828aa..d4a369cc9fa 100644 --- a/source4/lib/ldb/pyldb.c +++ b/source4/lib/ldb/pyldb.c @@ -26,9 +26,9 @@ License along with this library; if not, see . */ +#include #include "replace.h" #include "ldb_private.h" -#include #include "pyldb.h" /* There's no Py_ssize_t in 2.4, apparently */ diff --git a/source4/lib/messaging/pymessaging.c b/source4/lib/messaging/pymessaging.c index 33ccf782e9c..33746af26c7 100644 --- a/source4/lib/messaging/pymessaging.c +++ b/source4/lib/messaging/pymessaging.c @@ -19,8 +19,8 @@ along with this program. If not, see . */ -#include "includes.h" #include +#include "includes.h" #include "scripting/python/modules.h" #include "libcli/util/pyerrors.h" #include "librpc/rpc/pyrpc.h" diff --git a/source4/lib/registry/pyregistry.c b/source4/lib/registry/pyregistry.c index f68bfd15ef5..e98ac266117 100644 --- a/source4/lib/registry/pyregistry.c +++ b/source4/lib/registry/pyregistry.c @@ -17,9 +17,9 @@ along with this program. If not, see . */ +#include #include "includes.h" #include -#include #include "libcli/util/pyerrors.h" #include "lib/registry/registry.h" #include "scripting/python/modules.h" /* for py_iconv_convenience() */ diff --git a/source4/libnet/py_net.c b/source4/libnet/py_net.c index 5136fc54ebd..4d3e81ce26c 100644 --- a/source4/libnet/py_net.c +++ b/source4/libnet/py_net.c @@ -17,8 +17,8 @@ along with this program. If not, see . */ -#include "includes.h" #include +#include "includes.h" #include "libnet.h" #include "auth/credentials/pycredentials.h" #include "libcli/security/security.h" diff --git a/source4/librpc/rpc/pyrpc.c b/source4/librpc/rpc/pyrpc.c index e50a0776258..a24649daca4 100644 --- a/source4/librpc/rpc/pyrpc.c +++ b/source4/librpc/rpc/pyrpc.c @@ -17,8 +17,8 @@ along with this program. If not, see . */ -#include "includes.h" #include +#include "includes.h" #include #include "librpc/rpc/pyrpc.h" #include "librpc/rpc/dcerpc.h" diff --git a/source4/param/provision.c b/source4/param/provision.c index ddf3eec1b92..2f5f78abe65 100644 --- a/source4/param/provision.c +++ b/source4/param/provision.c @@ -18,6 +18,7 @@ along with this program. If not, see . */ +#include #include "includes.h" #include "auth/auth.h" #include "lib/ldb_wrap.h" @@ -29,7 +30,6 @@ #include "param/param.h" #include "param/provision.h" #include "param/secrets.h" -#include #include "lib/talloc/pytalloc.h" #include "librpc/rpc/pyrpc.h" #include "scripting/python/modules.h" diff --git a/source4/param/pyparam.c b/source4/param/pyparam.c index 58799f8d37f..eb2da11bb03 100644 --- a/source4/param/pyparam.c +++ b/source4/param/pyparam.c @@ -17,13 +17,10 @@ along with this program. If not, see . */ -#include -#include - +#include #include "includes.h" #include "param/param.h" #include "param/loadparm.h" -#include #include "pytalloc.h" /* There's no Py_ssize_t in 2.4, apparently */ diff --git a/source4/param/pyparam_util.c b/source4/param/pyparam_util.c index 9e4a6cdf648..e5c416bf843 100644 --- a/source4/param/pyparam_util.c +++ b/source4/param/pyparam_util.c @@ -17,13 +17,10 @@ along with this program. If not, see . */ -#include -#include - +#include #include "includes.h" #include "param/param.h" #include "param/loadparm.h" -#include #include "pytalloc.h" #define PyLoadparmContext_AsLoadparmContext(obj) py_talloc_get_type(obj, struct loadparm_context) diff --git a/source4/scripting/python/modules.c b/source4/scripting/python/modules.c index e53f4cfaf23..5365c5007d6 100644 --- a/source4/scripting/python/modules.c +++ b/source4/scripting/python/modules.c @@ -17,9 +17,9 @@ along with this program. If not, see . */ +#include #include "includes.h" #include "scripting/python/modules.h" -#include extern void init_ldb(void); extern void init_security(void); diff --git a/source4/scripting/python/pyglue.c b/source4/scripting/python/pyglue.c index 753f2df4640..71203d301cf 100644 --- a/source4/scripting/python/pyglue.c +++ b/source4/scripting/python/pyglue.c @@ -17,6 +17,7 @@ along with this program. If not, see . */ +#include #include "includes.h" #include "ldb.h" #include "ldb_errors.h" @@ -27,7 +28,6 @@ #include "lib/ldb-samba/ldif_handlers.h" #include "librpc/ndr/libndr.h" #include "version.h" -#include #include "lib/ldb/pyldb.h" #include "libcli/util/pyerrors.h" #include "libcli/security/security.h" diff --git a/source4/scripting/python/uuidmodule.c b/source4/scripting/python/uuidmodule.c index 98ef9adaa9c..3bfe0162cac 100644 --- a/source4/scripting/python/uuidmodule.c +++ b/source4/scripting/python/uuidmodule.c @@ -17,8 +17,8 @@ along with this program. If not, see . */ -#include "includes.h" #include +#include "includes.h" #include "librpc/ndr/libndr.h" static PyObject *uuid_random(PyObject *self, PyObject *args) diff --git a/source4/web_server/wsgi.c b/source4/web_server/wsgi.c index 4d6b441f170..48255bc205e 100644 --- a/source4/web_server/wsgi.c +++ b/source4/web_server/wsgi.c @@ -20,12 +20,12 @@ along with this program. If not, see . */ +#include #include "includes.h" #include "web_server/web_server.h" #include "../lib/util/dlinklist.h" #include "../lib/util/data_blob.h" #include "lib/tls/tls.h" -#include #ifndef Py_RETURN_NONE #define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None -- 2.11.4.GIT