Fix for python3

This commit is contained in:
Phil Howard
2016-02-28 11:10:55 +00:00
parent 8e29d40b02
commit 2fb6b49995
2 changed files with 6 additions and 1 deletions

View File

@@ -2,7 +2,7 @@ all: bindings
python setup.py build
bindings:
swig3.0 -python wiringpi.i
swig3.0 -python -threads wiringpi.i
install:
sudo python setup.py install

View File

@@ -1,6 +1,11 @@
%module wiringpi2
%{
#if PY_MAJOR_VERSION >= 3
#define PyInt_AS_LONG PyLong_AsLong
#define PyString_FromStringAndSize PyBytes_FromStringAndSize
#endif
#include "WiringPi/wiringPi/wiringPi.h"
#include "WiringPi/wiringPi/wiringPiI2C.h"
#include "WiringPi/wiringPi/wiringPiSPI.h"