File tree 2 files changed +2
-21
lines changed
2 files changed +2
-21
lines changed Original file line number Diff line number Diff line change @@ -280,13 +280,7 @@ _PyTestCapi_Init_HeaptypeRelative(PyObject *m) {
280
280
return -1 ;
281
281
}
282
282
283
- #ifdef __alignof_is_defined
284
- // C11
285
- PyModule_AddIntConstant (m , "alignof_max_align_t" , alignof(max_align_t ));
286
- #else
287
- // if alignof and max_align_t is unavailable, skip the alignment tests
288
- PyModule_AddIntConstant (m , "alignof_max_align_t" , 1 );
289
- #endif
283
+ PyModule_AddIntConstant (m , "alignof_max_align_t" , ALIGNOF_MAX_ALIGN_T );
290
284
291
285
return 0 ;
292
286
}
Original file line number Diff line number Diff line change @@ -3553,22 +3553,9 @@ static const PySlot_Offset pyslot_offsets[] = {
3553
3553
/* Align up to the nearest multiple of alignof(max_align_t)
3554
3554
* (like _Py_ALIGN_UP, but for a size rather than pointer)
3555
3555
*/
3556
- #if __alignof_is_defined
3557
- // C11
3558
- #define MAX_ALIGN alignof(max_align_t)
3559
- #else
3560
- // workaround for MSVC
3561
- typedef union {
3562
- intmax_t x ;
3563
- long double y ;
3564
- void * z ;
3565
- void (* f )();
3566
- } _max_align_t_wannabe ;
3567
- #define MAX_ALIGN _Alignof(_max_align_t_wannabe)
3568
- #endif
3569
3556
static Py_ssize_t
3570
3557
_align_up (Py_ssize_t size ) {
3571
- return (size + MAX_ALIGN - 1 ) & ~(MAX_ALIGN - 1 );
3558
+ return (size + ALIGNOF_MAX_ALIGN_T - 1 ) & ~(ALIGNOF_MAX_ALIGN_T - 1 );
3572
3559
}
3573
3560
3574
3561
/* Given a PyType_FromMetaclass `bases` argument (NULL, type, or tuple of
You can’t perform that action at this time.
0 commit comments