gh-103509: PEP 697 -- Limited C API for Extending Opaque Types (GH-103511)

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
This commit is contained in:
Petr Viktorin 2023-05-04 09:56:53 +02:00 committed by GitHub
parent 35d273825a
commit cd9a56c2b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 970 additions and 19 deletions

View file

@ -765,4 +765,15 @@ extern char * _getpty(int *, int, mode_t, int);
#undef __bool__
#endif
// Make sure we have maximum alignment, even if the current compiler
// does not support max_align_t. Note that:
// - Autoconf reports alignment of unknown types to 0.
// - 'long double' has maximum alignment on *most* platforms,
// looks like the best we can do for pre-C11 compilers.
// - The value is tested, see test_alignof_max_align_t
#if !defined(ALIGNOF_MAX_ALIGN_T) || ALIGNOF_MAX_ALIGN_T == 0
# undef ALIGNOF_MAX_ALIGN_T
# define ALIGNOF_MAX_ALIGN_T _Alignof(long double)
#endif
#endif /* Py_PYPORT_H */