summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2023-01-27 14:45:08 (GMT)
committerGitHub <noreply@github.com>2023-01-27 14:45:08 (GMT)
commit737d367b1f4bad76914173a64d6bbe19a984cd5f (patch)
treefc15b2c1c3dad1d49acd95304a0b1a85a1862388 /Include
parent7956e0c30001cc0940caa66fab4d72455c865b3a (diff)
downloadcpython-737d367b1f4bad76914173a64d6bbe19a984cd5f.zip
cpython-737d367b1f4bad76914173a64d6bbe19a984cd5f.tar.gz
cpython-737d367b1f4bad76914173a64d6bbe19a984cd5f.tar.bz2
gh-77532: Minor tweaks to allow compiling with PlatformToolset=ClangCL on Windows (GH-101352)
To use this, ensure that clang support was selected in Visual Studio Installer, then set the PlatformToolset environment variable to "ClangCL" and build as normal from the command line. It remains unsupported, but at least is possible now for experimentation.
Diffstat (limited to 'Include')
-rw-r--r--Include/cpython/pytime.h4
-rw-r--r--Include/internal/pycore_tracemalloc.h6
2 files changed, 8 insertions, 2 deletions
diff --git a/Include/cpython/pytime.h b/Include/cpython/pytime.h
index e64f3b1..16d88d1 100644
--- a/Include/cpython/pytime.h
+++ b/Include/cpython/pytime.h
@@ -53,6 +53,10 @@ functions and constants
extern "C" {
#endif
+#ifdef __clang__
+struct timeval;
+#endif
+
/* _PyTime_t: Python timestamp with subsecond precision. It can be used to
store a duration, and so indirectly a date (related to another date, like
UNIX epoch). */
diff --git a/Include/internal/pycore_tracemalloc.h b/Include/internal/pycore_tracemalloc.h
index 08d7d10..d086adc 100644
--- a/Include/internal/pycore_tracemalloc.h
+++ b/Include/internal/pycore_tracemalloc.h
@@ -36,11 +36,13 @@ struct _PyTraceMalloc_Config {
/* Pack the frame_t structure to reduce the memory footprint on 64-bit
architectures: 12 bytes instead of 16. */
+#if defined(_MSC_VER)
+#pragma pack(push, 4)
+#endif
+
struct
#ifdef __GNUC__
__attribute__((packed))
-#elif defined(_MSC_VER)
-#pragma pack(push, 4)
#endif
tracemalloc_frame {
/* filename cannot be NULL: "<unknown>" is used if the Python frame