diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c index a923e798c12a72..e2a8e692b88940 100644 --- a/Modules/_tracemalloc.c +++ b/Modules/_tracemalloc.c @@ -62,12 +62,15 @@ typedef struct #ifdef __GNUC__ __attribute__((packed)) #elif defined(_MSC_VER) -_declspec(align(4)) +#pragma pack(push, 4) #endif { PyObject *filename; unsigned int lineno; } frame_t; +#ifdef _MSC_VER +#pragma pack(pop) +#endif typedef struct { Py_uhash_t hash;