Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3019e36

Browse files
committed
build: keep Windows building on VS2019. #2145
1 parent c59a754 commit 3019e36

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

CHANGES.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,13 @@ Unreleased
3131
cause a problem, but now it's done properly, thanks to `Ellie Ayla
3232
<pull 2142_>`_.
3333

34+
- Fix: the C extension wouldn't build on VS2019, but now it does (`issue
35+
2145`_).
36+
3437
.. _issue 2138: https://github.com/coveragepy/coveragepy/issues/2138
3538
.. _issue 2141: https://github.com/coveragepy/coveragepy/issues/2141
3639
.. _pull 2142: https://github.com/coveragepy/coveragepy/pull/2142
40+
.. _issue 2145: https://github.com/coveragepy/coveragepy/issues/2145
3741

3842
.. start-releases
3943

coverage/ctracer/util.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@
55
#define _COVERAGE_UTIL_H
66

77
#include <Python.h>
8+
9+
#if defined(_MSC_VER) && _MSC_VER < 1939
10+
#define _Atomic volatile
11+
#define atomic_load(p) (*(p))
12+
#define atomic_store(p, v) _InterlockedExchange((p), (v))
13+
#else
814
#include <stdatomic.h>
15+
#endif
916

1017
/* Compile-time debugging helpers */
1118
#undef WHAT_LOG /* Define to log the WHAT params in the trace function. */

0 commit comments

Comments
 (0)