diff options
author | da-woods <dw-git@d-woods.co.uk> | 2021-04-18 07:37:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-18 08:37:57 +0200 |
commit | f79916155905490e59b3aeac635aefdacbbbc994 (patch) | |
tree | fc75eb32f9b8c4c34e2b75a0cace12de1a81159a | |
parent | 3d511fa74a996d170f5f071de70b1e05db531539 (diff) | |
download | cython-f79916155905490e59b3aeac635aefdacbbbc994.tar.gz |
Fix "platform_adaptation" documentation test on windows (GH-4126)
For reasons I don't full understand, including "windows.h" seems to break everything. There's an alternative sleep function in stdlib.h so I've used that instead since it makes the point just as well.
-rw-r--r-- | docs/examples/userguide/external_C_code/platform_adaptation.pyx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/docs/examples/userguide/external_C_code/platform_adaptation.pyx b/docs/examples/userguide/external_C_code/platform_adaptation.pyx index fa193f83d..0beece8f4 100644 --- a/docs/examples/userguide/external_C_code/platform_adaptation.pyx +++ b/docs/examples/userguide/external_C_code/platform_adaptation.pyx @@ -1,9 +1,8 @@ cdef extern from *: """ #if defined(_WIN32) || defined(MS_WINDOWS) || defined(_MSC_VER) - #define WIN32_LEAN_AND_MEAN - #include <windows.h> - #define myapp_sleep(m) Sleep(m) + #include "stdlib.h" + #define myapp_sleep(m) _sleep(m) #else #include <unistd.h> #define myapp_sleep(m) ((void) usleep((m) * 1000)) |