summaryrefslogtreecommitdiffstats
path: root/src/python
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2017-01-02 08:19:39 +0100
committerLukas Slebodnik <lslebodn@redhat.com>2017-01-02 12:33:58 +0100
commit69fb159e1464ef91376f56e65afa9704d5bafad8 (patch)
treedb3986417ffc3071f6e241f9c991f91d3911820c /src/python
parent50a6d01182aba430313746ba71c55e364bf9c6d6 (diff)
downloadsssd-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>
Diffstat (limited to 'src/python')
-rw-r--r--src/python/pyhbac.c2
-rw-r--r--src/python/pysss.c2
-rw-r--r--src/python/pysss_murmur.c4
-rw-r--r--src/python/pysss_nss_idmap.c4
4 files changed, 10 insertions, 2 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"