Skip to content

Commit e258226

Browse files
committed
Properly escape preprocessor directives
Otherwise swig will process them instead of the compiler Should have been in commit 170f855
1 parent 170f855 commit e258226

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

bindings/solv.i

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ typedef struct {
4444
#if defined(SWIGPYTHON)
4545
const void *pybuf = 0;
4646
Py_ssize_t pysize = 0;
47-
#if PY_VERSION_HEX >= 0x03000000
48-
res = PyBytes_AsStringAndSize($input, &pybuf, &pysize);
49-
#else
47+
%#if PY_VERSION_HEX >= 0x03000000
48+
res = PyBytes_AsStringAndSize($input, (char **)&pybuf, &pysize);
49+
%#else
5050
res = PyObject_AsReadBuffer($input, &pybuf, &pysize);
51-
#endif
51+
%#endif
5252
if (res < 0) {
5353
%argument_fail(res, "BinaryBlob", $symname, $argnum);
5454
} else {

0 commit comments

Comments
 (0)