vendor/scs/include/glbopts.h in scs-0.3.2 vs vendor/scs/include/glbopts.h in scs-0.4.0
- old
+ new
@@ -12,11 +12,11 @@
#define SCS(x) _scs_##x
#endif
/* SCS VERSION NUMBER ---------------------------------------------- */
/* string literals automatically null-terminated */
-#define SCS_VERSION ("3.1.1")
+#define SCS_VERSION ("3.2.0")
/* verbosity level */
#ifndef VERBOSITY
#define VERBOSITY (0)
#endif
@@ -47,10 +47,13 @@
#define scs_malloc mxMalloc
#define scs_calloc mxCalloc
#define scs_realloc mxRealloc
#elif defined PYTHON
#include <Python.h>
+/* see:
+ * https://cython-users.narkive.com/jRjjs3sK/reacquire-gil-for-printing-in-wrapped-c-library
+ */
#define scs_printf(...) \
{ \
PyGILState_STATE gilstate = PyGILState_Ensure(); \
PySys_WriteStdout(__VA_ARGS__); \
PyGILState_Release(gilstate); \
@@ -58,12 +61,10 @@
#if PY_MAJOR_VERSION >= 3
#define scs_free PyMem_RawFree
#define scs_malloc PyMem_RawMalloc
#define scs_realloc PyMem_RawRealloc
#define scs_calloc PyMem_RawCalloc
-/* only for SuiteSparse + python */
-#define _scs_printf PySys_WriteStdout
#else
#define scs_free PyMem_Free
#define scs_malloc PyMem_Malloc
#define scs_realloc PyMem_Realloc
static inline void *scs_calloc(size_t count, size_t size) {
@@ -104,11 +105,9 @@
#endif
#ifndef INFINITY
#define INFINITY NAN
#endif
#endif
-
-#define SCS_NULL 0
#ifndef MAX
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif