mirror of
https://github.com/openssl/openssl.git
synced 2025-02-17 14:32:04 +08:00
e_os2: add ossl_static_assert_type_eq
Add a gcc-only static assertion that a variable is of a specified type. Signed-off-by: Čestmír Kalina <ckalina@redhat.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12256)
This commit is contained in:
parent
232dd87c55
commit
0e200d2a19
@ -22,6 +22,15 @@
|
||||
* outside; this file e_os.h is not part of the exported interface.
|
||||
*/
|
||||
|
||||
/* ossl_static_assert_type_eq: gcc-only variable type static assertion */
|
||||
# if defined(__GNUC__) && !defined(__clang__)
|
||||
# define ossl_static_assert_type_eq(type, x) \
|
||||
_Static_assert((__builtin_types_compatible_p(type, __typeof__(x))), \
|
||||
#x " type check failed, expected: " #type)
|
||||
# else
|
||||
# define ossl_static_assert_type_eq(type, x)
|
||||
# endif
|
||||
|
||||
# if defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_UEFI)
|
||||
# define NO_CHMOD
|
||||
# define NO_SYSLOG
|
||||
|
Loading…
Reference in New Issue
Block a user