From b68846c9a8090d03b48f9247af40b7b8df10714b Mon Sep 17 00:00:00 2001 From: krw Date: Mon, 21 Jun 2021 13:17:20 +0000 Subject: [PATCH] Wrap #define nitems in #ifndef nitems/#endif. While here fix a misplaced '(' to make this nitems the same as all its friends. Pointed out by okan@ --- sbin/fdisk/part.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sbin/fdisk/part.c b/sbin/fdisk/part.c index ac1d2ff8606..a09f84a9223 100644 --- a/sbin/fdisk/part.c +++ b/sbin/fdisk/part.c @@ -1,4 +1,4 @@ -/* $OpenBSD: part.c,v 1.86 2021/06/21 02:05:30 krw Exp $ */ +/* $OpenBSD: part.c,v 1.87 2021/06/21 13:17:20 krw Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -152,7 +152,9 @@ static const struct protected_guid { { "2e54b353-1271-4842-806f-e436d6af6985" }, /* HiFive BBL */ }; -#define nitems(_a) ((sizeof(_a)) / sizeof((_a)[0])) +#ifndef nitems +#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0])) +#endif int PRT_protected_guid(struct uuid *leuuid) -- 2.20.1