The branch, master has been updated
via bfbd47b7de65aa41c433945283d7bc0ebfa5576a (commit)
via fcda9c6a208d3a7fe651ef661b2eb6e462a89c17 (commit)
from 91dbb659016da3166c3e11bb8f83d7aa5b93f4d6 (commit)
- Log -----------------------------------------------------------------
commit bfbd47b7de65aa41c433945283d7bc0ebfa5576a
Author: Jordan Rupprecht <rupprecht@xxxxxxxxxx>
Date: Thu Sep 20 11:05:56 2018 -0700
Use a separate Py_ssize_t var instead of casting an int pointer as a
Py_ssize_t pointer.
Casting is fine if Py_ssize_t == int, but not when Py_ssize_t == long.
Signed-off-by: Jordan Rupprecht <rupprecht@xxxxxxxxxx>
commit fcda9c6a208d3a7fe651ef661b2eb6e462a89c17
Author: Eneas U de Queiroz <cote2004-github@xxxxxxxxx>
Date: Tue Jul 31 17:44:57 2018 -0300
CMake: use find_package (SWIG) for cmake >= 3.0.0
There's a workaround for a bug (fixed in cmake 3.0.0) that does not
work in CMake 3.12. Only use the workaround with cmake < 3.0.0.
Signed-off-by: Eneas U de Queiroz <cote2004-github@xxxxxxxxx>
-----------------------------------------------------------------------
Summary of changes:
python/CMakeLists.txt | 2 +-
python/ftdi1.i | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index 4843396..7bdd9f9 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -1,5 +1,5 @@
# workaround for cmake bug #0013449
-if ( NOT DEFINED CMAKE_FIND_ROOT_PATH )
+if ( NOT DEFINED CMAKE_FIND_ROOT_PATH OR CMAKE_VERSION VERSION_GREATER_EQUAL
3.0.0 )
find_package ( SWIG REQUIRED )
else ()
find_program ( SWIG_EXECUTABLE NAMES swig2.0 swig )
diff --git a/python/ftdi1.i b/python/ftdi1.i
index 93793f8..d53ebb0 100644
--- a/python/ftdi1.i
+++ b/python/ftdi1.i
@@ -22,11 +22,13 @@ inline PyObject* charp2str(const char *v_, long len)
inline char * str2charp_size(PyObject* pyObj, int * size)
{
char * v_ = 0;
+ Py_ssize_t len = 0;
#if PY_MAJOR_VERSION >= 3
- PyBytes_AsStringAndSize(pyObj, &v_, (Py_ssize_t*)size);
+ PyBytes_AsStringAndSize(pyObj, &v_, &len);
#else
- PyString_AsStringAndSize(pyObj, &v_, (Py_ssize_t*)size);
+ PyString_AsStringAndSize(pyObj, &v_, &len);
#endif
+ *size = len;
return v_;
}
%}
hooks/post-receive
--
A library to talk to FTDI chips
--
libftdi-git - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi-git+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx
|