|
1 | 1 |
|
2 | 2 | #define PY_SSIZE_T_CLEAN |
3 | 3 | #include <math.h> |
4 | | -#ifndef __wasi__ |
| 4 | +#if !defined(__wasi__) && !defined(_WIN32) |
5 | 5 | #include <poll.h> |
6 | 6 | #endif |
7 | 7 | #include <stdint.h> |
8 | 8 | #include <stdlib.h> |
9 | 9 | #include <string.h> |
10 | | -#ifndef __wasi__ |
| 10 | +#if !defined(__wasi__) && !defined(_WIN32) |
11 | 11 | #include <sys/mman.h> |
12 | 12 | #include <sys/socket.h> |
13 | | -#endif |
14 | 13 | #include <unistd.h> |
| 14 | +#endif |
15 | 15 | #include <Python.h> |
16 | 16 |
|
17 | 17 | #ifndef Py_LIMITED_API |
@@ -5722,7 +5722,7 @@ static PyObject *call_function_accel(PyObject *self, PyObject *args, PyObject *k |
5722 | 5722 | goto exit; |
5723 | 5723 | } |
5724 | 5724 |
|
5725 | | -#ifndef __wasi__ |
| 5725 | +#if !defined(__wasi__) && !defined(_WIN32) |
5726 | 5726 | /* |
5727 | 5727 | * mmap_read(fd, length) -> bytes |
5728 | 5728 | * |
@@ -5875,24 +5875,24 @@ static PyObject *accel_recv_exact(PyObject *self, PyObject *args) { |
5875 | 5875 | free(buf); |
5876 | 5876 | return result; |
5877 | 5877 | } |
5878 | | -#else /* __wasi__ stubs — importable but raise NotImplementedError if called */ |
| 5878 | +#else /* __wasi__ / _WIN32 stubs */ |
5879 | 5879 |
|
5880 | 5880 | static PyObject *accel_mmap_read(PyObject *self, PyObject *args) { |
5881 | | - PyErr_SetString(PyExc_NotImplementedError, "mmap_read is not available in WASM"); |
| 5881 | + PyErr_SetString(PyExc_NotImplementedError, "mmap_read is not available on this platform"); |
5882 | 5882 | return NULL; |
5883 | 5883 | } |
5884 | 5884 |
|
5885 | 5885 | static PyObject *accel_mmap_write(PyObject *self, PyObject *args) { |
5886 | | - PyErr_SetString(PyExc_NotImplementedError, "mmap_write is not available in WASM"); |
| 5886 | + PyErr_SetString(PyExc_NotImplementedError, "mmap_write is not available on this platform"); |
5887 | 5887 | return NULL; |
5888 | 5888 | } |
5889 | 5889 |
|
5890 | 5890 | static PyObject *accel_recv_exact(PyObject *self, PyObject *args) { |
5891 | | - PyErr_SetString(PyExc_NotImplementedError, "recv_exact is not available in WASM"); |
| 5891 | + PyErr_SetString(PyExc_NotImplementedError, "recv_exact is not available on this platform"); |
5892 | 5892 | return NULL; |
5893 | 5893 | } |
5894 | 5894 |
|
5895 | | -#endif /* !__wasi__ */ |
| 5895 | +#endif /* !__wasi__ && !_WIN32 */ |
5896 | 5896 |
|
5897 | 5897 | static PyMethodDef PyMySQLAccelMethods[] = { |
5898 | 5898 | {"read_rowdata_packet", (PyCFunction)read_rowdata_packet, METH_VARARGS | METH_KEYWORDS, "PyMySQL row data packet reader"}, |
|
0 commit comments