Codechange: Replace assert_compile macro with static_assert

This commit is contained in:
Charles Pigott
2020-12-27 10:44:22 +00:00
parent 395a5d9991
commit 860c270c73
77 changed files with 133 additions and 135 deletions

View File

@@ -210,7 +210,7 @@ static inline bool SetNoDelay(SOCKET d)
}
/* Make sure these structures have the size we expect them to be */
assert_compile(sizeof(in_addr) == 4); ///< IPv4 addresses should be 4 bytes.
assert_compile(sizeof(in6_addr) == 16); ///< IPv6 addresses should be 16 bytes.
static_assert(sizeof(in_addr) == 4); ///< IPv4 addresses should be 4 bytes.
static_assert(sizeof(in6_addr) == 16); ///< IPv6 addresses should be 16 bytes.
#endif /* NETWORK_CORE_OS_ABSTRACTION_H */

View File

@@ -18,10 +18,10 @@
#include "../../safeguards.h"
/* Make sure that these enums match. */
assert_compile((int)CRR_MANUAL == (int)ADMIN_CRR_MANUAL);
assert_compile((int)CRR_AUTOCLEAN == (int)ADMIN_CRR_AUTOCLEAN);
assert_compile((int)CRR_BANKRUPT == (int)ADMIN_CRR_BANKRUPT);
assert_compile((int)CRR_END == (int)ADMIN_CRR_END);
static_assert((int)CRR_MANUAL == (int)ADMIN_CRR_MANUAL);
static_assert((int)CRR_AUTOCLEAN == (int)ADMIN_CRR_AUTOCLEAN);
static_assert((int)CRR_BANKRUPT == (int)ADMIN_CRR_BANKRUPT);
static_assert((int)CRR_END == (int)ADMIN_CRR_END);
/**
* Create the admin handler for the given socket.