Skip to content

Commit

Permalink
specify default target Windows version
Browse files Browse the repository at this point in the history
inherit Py_WIN_VER by default unless specified in extra macros
  • Loading branch information
minrk committed Jan 20, 2021
1 parent 73c6a44 commit 5168dd9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 3 additions & 1 deletion zmq/backend/cffi/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ def _buffer_from_zmq_msg(self):
for Frames created by recv
"""
if self._data is None:
self._data = ffi.buffer(C.zmq_msg_data(self.zmq_msg), C.zmq_msg_size(self.zmq_msg))
self._data = ffi.buffer(
C.zmq_msg_data(self.zmq_msg), C.zmq_msg_size(self.zmq_msg)
)
if self._buffer is None:
self._buffer = memoryview(self._data)

Expand Down
12 changes: 12 additions & 0 deletions zmq/utils/pyversion_compat.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
#include "Python.h"

// default to Python's own target Windows version(s)
// override by setting WINVER, _WIN32_WINNT, (maybe also NTDDI_VERSION?) macros
#ifdef Py_WINVER
#ifndef WINVER
#define WINVER Py_WINVER
#endif
#ifndef _WIN32_WINNT
#define _WIN32_WINNT Py_WINVER
#endif
#endif


#if PY_VERSION_HEX < 0x02070000
#define PyMemoryView_FromBuffer(info) (PyErr_SetString(PyExc_NotImplementedError, \
"new buffer interface is not available"), (PyObject *)NULL)
Expand Down

0 comments on commit 5168dd9

Please sign in to comment.