From ca9586a4f0d8a5a7bc9243efc74d209e598bde62 Mon Sep 17 00:00:00 2001 From: miod Date: Tue, 16 Jul 2024 06:18:20 +0000 Subject: [PATCH] Only perform the static_assert checks in C>=11 environment; unbreaks build on platforms using gcc. --- usr.sbin/radiusd/eap2mschap_local.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.sbin/radiusd/eap2mschap_local.h b/usr.sbin/radiusd/eap2mschap_local.h index ff761f27524..b3d523d920f 100644 --- a/usr.sbin/radiusd/eap2mschap_local.h +++ b/usr.sbin/radiusd/eap2mschap_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: eap2mschap_local.h,v 1.1 2024/07/14 16:09:23 yasuoka Exp $ */ +/* $OpenBSD: eap2mschap_local.h,v 1.2 2024/07/16 06:18:20 miod Exp $ */ /* * Copyright (c) 2024 Internet Initiative Japan Inc. @@ -70,9 +70,11 @@ struct eap_mschap_challenge { uint8_t chall[16]; char chap_name[0]; } __packed; +#if defined(__STDC_VERSION__) && __STDC_VERSION >= 201112L static_assert(sizeof(struct eap_mschap_challenge) == 26, ""); static_assert(offsetof(struct eap_mschap_challenge, chap) == 5, ""); static_assert(offsetof(struct eap_mschap_challenge, chall) == 10, ""); +#endif struct eap_mschap_response { struct eap eap; @@ -85,9 +87,11 @@ struct eap_mschap_response { uint8_t flags; uint8_t chap_name[0]; } __packed; +#if defined(__STDC_VERSION__) && __STDC_VERSION >= 201112L static_assert(sizeof(struct eap_mschap_response) == 59, ""); static_assert(offsetof(struct eap_mschap_response, chap) == 5, ""); static_assert(offsetof(struct eap_mschap_response, peerchall) == 10, ""); +#endif struct radius_ms_chap2_response { uint8_t ident; -- 2.20.1