diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2017-01-02 08:19:39 +0100 |
---|---|---|
committer | Lukas Slebodnik <lslebodn@redhat.com> | 2017-01-02 12:33:58 +0100 |
commit | 69fb159e1464ef91376f56e65afa9704d5bafad8 (patch) | |
tree | db3986417ffc3071f6e241f9c991f91d3911820c | |
parent | 50a6d01182aba430313746ba71c55e364bf9c6d6 (diff) | |
download | sssd-69fb159e1464ef91376f56e65afa9704d5bafad8.tar.gz sssd-69fb159e1464ef91376f56e65afa9704d5bafad8.tar.xz sssd-69fb159e1464ef91376f56e65afa9704d5bafad8.zip |
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 <jhrozek@redhat.com>
-rw-r--r-- | src/python/pyhbac.c | 2 | ||||
-rw-r--r-- | src/python/pysss.c | 2 | ||||
-rw-r--r-- | src/python/pysss_murmur.c | 4 | ||||
-rw-r--r-- | src/python/pysss_nss_idmap.c | 4 | ||||
-rw-r--r-- | src/util/sss_python.c | 1 | ||||
-rw-r--r-- | src/util/sss_python.h | 3 |
6 files changed, 13 insertions, 3 deletions
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 <http://www.gnu.org/licenses/>. */ +#include "config.h" + #include <Python.h> #include <structmember.h> 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 <http://www.gnu.org/licenses/>. */ +#include "config.h" + #include <Python.h> #include <structmember.h> #include <talloc.h> 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 <http://www.gnu.org/licenses/>. */ +#include "config.h" + #include <Python.h> -#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 <http://www.gnu.org/licenses/>. */ +#include "config.h" + #include <Python.h> -#include "util/sss_python.h" +#include "util/sss_python.h" #include "sss_client/idmap/sss_nss_idmap.h" #define SSS_NAME_KEY "name" diff --git a/src/util/sss_python.c b/src/util/sss_python.c index 560effc26..ed607d044 100644 --- a/src/util/sss_python.c +++ b/src/util/sss_python.c @@ -19,7 +19,6 @@ */ #include "src/util/sss_python.h" -#include "config.h" PyObject * sss_exception_with_doc(char *name, char *doc, PyObject *base, PyObject *dict) diff --git a/src/util/sss_python.h b/src/util/sss_python.h index b3fdaad64..26ecd71bd 100644 --- a/src/util/sss_python.h +++ b/src/util/sss_python.h @@ -1,8 +1,11 @@ #ifndef __SSS_PYTHON_H__ #define __SSS_PYTHON_H__ +#include "config.h" + #include <Python.h> #include <stdbool.h> + #include "util/util.h" #if PY_VERSION_HEX < 0x02050000 |