mirror of
git://soft.sys114.com/WiringPi2-Python
synced 2026-02-04 18:00:36 +09:00
Fix for python3
This commit is contained in:
2
Makefile
2
Makefile
@@ -2,7 +2,7 @@ all: bindings
|
|||||||
python setup.py build
|
python setup.py build
|
||||||
|
|
||||||
bindings:
|
bindings:
|
||||||
swig3.0 -python wiringpi.i
|
swig3.0 -python -threads wiringpi.i
|
||||||
|
|
||||||
install:
|
install:
|
||||||
sudo python setup.py install
|
sudo python setup.py install
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
%module wiringpi2
|
%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/wiringPi.h"
|
||||||
#include "WiringPi/wiringPi/wiringPiI2C.h"
|
#include "WiringPi/wiringPi/wiringPiI2C.h"
|
||||||
#include "WiringPi/wiringPi/wiringPiSPI.h"
|
#include "WiringPi/wiringPi/wiringPiSPI.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user