From: martijn Date: Mon, 13 Nov 2023 15:05:14 +0000 (+0000) Subject: Apparently base-gcc doesn't like having OID() inside MIBDECL(). Handroll X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=5645d436417c6d6b148acbf5d86500f60d253ab4;p=openbsd Apparently base-gcc doesn't like having OID() inside MIBDECL(). Handroll the OID() logic into MIBDECL(). Found, tested, and OK jca@ OK tb@ --- diff --git a/usr.sbin/snmpd/snmpd.h b/usr.sbin/snmpd/snmpd.h index b1ecd5cce0a..50472036a87 100644 --- a/usr.sbin/snmpd/snmpd.h +++ b/usr.sbin/snmpd/snmpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: snmpd.h,v 1.113 2023/11/12 20:14:39 martijn Exp $ */ +/* $OpenBSD: snmpd.h,v 1.114 2023/11/13 15:05:14 martijn Exp $ */ /* * Copyright (c) 2007, 2008, 2012 Reyk Floeter @@ -176,7 +176,8 @@ struct privsep_fd { #define OID(...) (struct ber_oid){ { __VA_ARGS__ }, \ (sizeof((uint32_t []) { __VA_ARGS__ }) / sizeof(uint32_t)) } -#define MIBDECL(...) OID(MIB_##__VA_ARGS__), #__VA_ARGS__ +#define MIBDECL(...) { { MIB_##__VA_ARGS__ }, \ + (sizeof((uint32_t []) { MIB_##__VA_ARGS__ }) / sizeof(uint32_t))}, #__VA_ARGS__ #define MIB(...) { { MIB_##__VA_ARGS__ } }, NULL #define MIBEND { { 0 } }, NULL