From 69fb159e1464ef91376f56e65afa9704d5bafad8 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Mon, 2 Jan 2017 08:19:39 +0100 Subject: Fix compilation with python3.6 Autotools does not generate defines in conditional way (ifndef .. define) and therefore it might happen that "defines" in config.h migt redefine some macros in different way and generate a warning. e.g. In file included from /home/build/sssd/src/util/util.h:24:0, from /home/build/sssd/src/python/pyhbac.c:24: ./config.h:322:0: error: "HAVE_LONG_LONG" redefined [-Werror] #define HAVE_LONG_LONG 1 In file included from /usr/include/python3.6m/Python.h:50:0, from /home/build/sssd/src/python/pyhbac.c:21: /usr/include/python3.6m/pyport.h:42:0: note: this is the location of the previous definition #define HAVE_LONG_LONG We need to include config.h before Python.h to avoid redefinition of HAVE_LONG_LONG which is definded conditionally in Python.h Reviewed-by: Jakub Hrozek --- src/python/pyhbac.c | 2 ++ src/python/pysss.c | 2 ++ src/python/pysss_murmur.c | 4 +++- src/python/pysss_nss_idmap.c | 4 +++- 4 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src/python') diff --git a/src/python/pyhbac.c b/src/python/pyhbac.c index eb424c6dd..09d308a0f 100644 --- a/src/python/pyhbac.c +++ b/src/python/pyhbac.c @@ -18,6 +18,8 @@ along with this program. If not, see . */ +#include "config.h" + #include #include diff --git a/src/python/pysss.c b/src/python/pysss.c index 6bd8f5a92..dc1c1ff1f 100644 --- a/src/python/pysss.c +++ b/src/python/pysss.c @@ -18,6 +18,8 @@ along with this program. If not, see . */ +#include "config.h" + #include #include #include diff --git a/src/python/pysss_murmur.c b/src/python/pysss_murmur.c index b14a67202..a7519e856 100644 --- a/src/python/pysss_murmur.c +++ b/src/python/pysss_murmur.c @@ -18,9 +18,11 @@ along with this program. If not, see . */ +#include "config.h" + #include -#include "util/sss_python.h" +#include "util/sss_python.h" #include "util/murmurhash3.h" PyDoc_STRVAR(murmurhash3_doc, diff --git a/src/python/pysss_nss_idmap.c b/src/python/pysss_nss_idmap.c index a88ef77a3..c57cc10a8 100644 --- a/src/python/pysss_nss_idmap.c +++ b/src/python/pysss_nss_idmap.c @@ -19,9 +19,11 @@ along with this program. If not, see . */ +#include "config.h" + #include -#include "util/sss_python.h" +#include "util/sss_python.h" #include "sss_client/idmap/sss_nss_idmap.h" #define SSS_NAME_KEY "name" -- cgit