s4-python: we need to include Python.h first
authorAndrew Tridgell <tridge@samba.org>
Fri, 23 Oct 2009 05:23:01 +0000 (16:23 +1100)
committerAndrew Tridgell <tridge@samba.org>
Fri, 23 Oct 2009 05:23:01 +0000 (16:23 +1100)
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.

16 files changed:
libcli/nbt/pynbt.c
source4/auth/credentials/pycredentials.c
source4/auth/gensec/pygensec.c
source4/lib/com/pycom.c
source4/lib/ldb/pyldb.c
source4/lib/messaging/pymessaging.c
source4/lib/registry/pyregistry.c
source4/libnet/py_net.c
source4/librpc/rpc/pyrpc.c
source4/param/provision.c
source4/param/pyparam.c
source4/param/pyparam_util.c
source4/scripting/python/modules.c
source4/scripting/python/pyglue.c
source4/scripting/python/uuidmodule.c
source4/web_server/wsgi.c

index 9be6c79a8b23fe4784734037a45dd42fd1bcb512..425ad13c6dd87cdce31ad844a8834bf94069598f 100644 (file)
@@ -17,8 +17,8 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "includes.h"
 #include <Python.h>
+#include "includes.h"
 #include "libcli/util/pyerrors.h"
 #include "scripting/python/modules.h"
 #include "../libcli/nbt/libnbt.h"
index b0433abeab150d9a7781fea32cb43e7c0117d493..59a200b09e1365ebbcaad71a27c19b86baa194f5 100644 (file)
@@ -16,8 +16,8 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "includes.h"
 #include <Python.h>
+#include "includes.h"
 #include "pycredentials.h"
 #include "param/param.h"
 #include "lib/cmdline/credentials.h"
index c799ffd75c6dc64531a2febe4497dd03f8af1ee9..87c38053a7432311de6dccde27149ba366e47e4f 100644 (file)
@@ -16,8 +16,8 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "includes.h"
 #include <Python.h>
+#include "includes.h"
 #include "param/pyparam.h"
 #include "auth/gensec/gensec.h"
 #include "libcli/util/pyerrors.h"
index d5a07580ea1dbf405b78372197368d474c585d61..86e794e173280e5816fa3dd0de1d33328796c47a 100644 (file)
@@ -17,8 +17,8 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "includes.h"
 #include <Python.h>
+#include "includes.h"
 #include "lib/com/com.h"
 #include "librpc/ndr/libndr.h"
 #include "libcli/util/pyerrors.h"
index 35508c828aa52a58ed075793b21302a67925d337..d4a369cc9faecd7bffe80d09e70b9e400aeea150 100644 (file)
@@ -26,9 +26,9 @@
    License along with this library; if not, see <http://www.gnu.org/licenses/>.
 */
 
+#include <Python.h>
 #include "replace.h"
 #include "ldb_private.h"
-#include <Python.h>
 #include "pyldb.h"
 
 /* There's no Py_ssize_t in 2.4, apparently */
index 33ccf782e9cf2bf0e435b965eb8078602ba9f2e4..33746af26c7076bc07e9c4b3b7bd784a4524729f 100644 (file)
@@ -19,8 +19,8 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "includes.h"
 #include <Python.h>
+#include "includes.h"
 #include "scripting/python/modules.h"
 #include "libcli/util/pyerrors.h"
 #include "librpc/rpc/pyrpc.h"
index f68bfd15ef5deddd8f93bb2eee70d94879f68097..e98ac266117045c6c50d084936996be9c65ae66b 100644 (file)
@@ -17,9 +17,9 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#include <Python.h>
 #include "includes.h"
 #include <tevent.h>
-#include <Python.h>
 #include "libcli/util/pyerrors.h"
 #include "lib/registry/registry.h"
 #include "scripting/python/modules.h" /* for py_iconv_convenience() */
index 5136fc54ebdafeb35fa06083e7ccb95def7f76aa..4d3e81ce26c16ca0a6d756f0575257c3e8d10f97 100644 (file)
@@ -17,8 +17,8 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "includes.h"
 #include <Python.h>
+#include "includes.h"
 #include "libnet.h"
 #include "auth/credentials/pycredentials.h"
 #include "libcli/security/security.h"
index e50a0776258e341001bb253cfe727a2e00e69726..a24649daca40c1b53657366dc286e9eae9c959f5 100644 (file)
@@ -17,8 +17,8 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "includes.h"
 #include <Python.h>
+#include "includes.h"
 #include <structmember.h>
 #include "librpc/rpc/pyrpc.h"
 #include "librpc/rpc/dcerpc.h"
index ddf3eec1b9243b5537aa3638e3b250c1904ec851..2f5f78abe65e78e2f4f39ed5ef0b85087bce0e61 100644 (file)
@@ -18,6 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#include <Python.h>
 #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 <Python.h>
 #include "lib/talloc/pytalloc.h"
 #include "librpc/rpc/pyrpc.h"
 #include "scripting/python/modules.h"
index 58799f8d37f15c7eaae4257563a53298fd713fce..eb2da11bb03e20c4da1db755c754a4f501ffafc5 100644 (file)
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <stdint.h>
-#include <stdbool.h>
-
+#include <Python.h>
 #include "includes.h"
 #include "param/param.h"
 #include "param/loadparm.h"
-#include <Python.h>
 #include "pytalloc.h"
 
 /* There's no Py_ssize_t in 2.4, apparently */
index 9e4a6cdf648171e650ea1d6e6401472c724e33f2..e5c416bf8437888ae460ce07636d2be1a42f75a2 100644 (file)
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <stdint.h>
-#include <stdbool.h>
-
+#include <Python.h>
 #include "includes.h"
 #include "param/param.h"
 #include "param/loadparm.h"
-#include <Python.h>
 #include "pytalloc.h"
 
 #define PyLoadparmContext_AsLoadparmContext(obj) py_talloc_get_type(obj, struct loadparm_context)
index e53f4cfaf234cb03379fe78e2829c4d55c382b78..5365c5007d6aa97f50b0595685d03fccf75f3c95 100644 (file)
@@ -17,9 +17,9 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#include <Python.h>
 #include "includes.h"
 #include "scripting/python/modules.h"
-#include <Python.h>
 
 extern void init_ldb(void);
 extern void init_security(void);
index 753f2df4640ab869b6ad493017f8a3b361121932..71203d301cf49909fcad5d2059d603f0323767af 100644 (file)
@@ -17,6 +17,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#include <Python.h>
 #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 <Python.h>
 #include "lib/ldb/pyldb.h"
 #include "libcli/util/pyerrors.h"
 #include "libcli/security/security.h"
index 98ef9adaa9c6a981e3e8703dcafa7e7ee7e3e9d5..3bfe0162cacefd13a00a8a5df28ed09469443e0a 100644 (file)
@@ -17,8 +17,8 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "includes.h"
 #include <Python.h>
+#include "includes.h"
 #include "librpc/ndr/libndr.h"
 
 static PyObject *uuid_random(PyObject *self, PyObject *args)
index 4d6b441f170c1a290d41f99579fb4ea38c5cb37e..48255bc205ee94cf62939b8bf2d413ed2a55aec2 100644 (file)
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#include <Python.h>
 #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 <Python.h>
 
 #ifndef Py_RETURN_NONE
 #define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None