From nobody Mon Feb 9 18:18:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1560874577; cv=none; d=zoho.com; s=zohoarc; b=R0zKXQ/CAkk3IL6klq6r5PiJT4M4RoXGNUkvoUDVBgmlJ2axJaBgiNvsdrXZ6ytI6FEfhNWZ9SFQHLwSx8lbkCCmo6ERzaMG1xq2wQdaT12AFpf1IRMDNJtaUth/WhxNmjREFfZQJ9ErY5CRizkJ+wgU9CM4dr/Az3lIT0mimm4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874577; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Y3vhkcScgu/Dv3vZE8YpkB8hG0srh3hr4qrOyITcxUk=; b=I4j6s0CSKuENzCchwQJ+xkYpY7QKMNxHDoyOo94/HK41BN74JO1Kmw1BXIpq7FvgEdo3ZEIsXgOiRNAV7+DPT/r2ecMl8WZsrGC65vu42ikQyuMzwfGkRyyyuLvr66OMkm4PQBMSvxUxUhzL/YFTMM8+pXkNE2Rcf4RCf8qmR/A= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1560874577267730.0515626640703; Tue, 18 Jun 2019 09:16:17 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9A7CF307D871; Tue, 18 Jun 2019 16:16:15 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7538984EF; Tue, 18 Jun 2019 16:16:15 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 367551806B23; Tue, 18 Jun 2019 16:16:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x5IGDWAG024282 for ; Tue, 18 Jun 2019 12:13:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8D93B60FAB; Tue, 18 Jun 2019 16:13:32 +0000 (UTC) Received: from aegolius.redhat.com (ovpn-117-198.phx2.redhat.com [10.3.117.198]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 573AB84EF for ; Tue, 18 Jun 2019 16:13:32 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:55 -0500 Message-Id: <20190618161316.1722-26-jjongsma@redhat.com> In-Reply-To: <20190618161316.1722-1-jjongsma@redhat.com> References: <20190618161316.1722-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 25/46] util: error: use #pragma once in headers X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 18 Jun 2019 16:16:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/virerror.h | 41 +++++++++++++++++++---------------------- src/util/virerrorpriv.h | 5 +---- 2 files changed, 20 insertions(+), 26 deletions(-) diff --git a/src/util/virerror.h b/src/util/virerror.h index 8f51510dc2..4cfb0c18dd 100644 --- a/src/util/virerror.h +++ b/src/util/virerror.h @@ -19,13 +19,12 @@ * */ =20 -#ifndef LIBVIRT_VIRERROR_H -# define LIBVIRT_VIRERROR_H +#pragma once =20 -# include "internal.h" -# include "virautoclean.h" +#include "internal.h" +#include "virautoclean.h" =20 -# define VIR_ERROR_MAX_LENGTH 1024 +#define VIR_ERROR_MAX_LENGTH 1024 =20 extern virErrorFunc virErrorHandler; extern void *virUserData; @@ -65,13 +64,13 @@ void virReportSystemErrorFull(int domcode, const char *fmt, ...) ATTRIBUTE_FMT_PRINTF(6, 7); =20 -# define virReportSystemError(theerrno, fmt,...) \ +#define virReportSystemError(theerrno, fmt,...) \ virReportSystemErrorFull(VIR_FROM_THIS, \ (theerrno), \ __FILE__, __FUNCTION__, __LINE__, \ (fmt), __VA_ARGS__) =20 -# define virReportInvalidNullArg(argname) \ +#define virReportInvalidNullArg(argname) \ virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \ VIR_FROM_THIS, \ VIR_ERR_INVALID_ARG, \ @@ -82,7 +81,7 @@ void virReportSystemErrorFull(int domcode, 0, 0, \ _("%s in %s must be NULL"), \ #argname, __FUNCTION__) -# define virReportInvalidNonNullArg(argname) \ +#define virReportInvalidNonNullArg(argname) \ virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \ VIR_FROM_THIS, \ VIR_ERR_INVALID_ARG, \ @@ -93,7 +92,7 @@ void virReportSystemErrorFull(int domcode, 0, 0, \ _("%s in %s must not be NULL"), \ #argname, __FUNCTION__) -# define virReportInvalidEmptyStringArg(argname) \ +#define virReportInvalidEmptyStringArg(argname) \ virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \ VIR_FROM_THIS, \ VIR_ERR_INVALID_ARG, \ @@ -104,7 +103,7 @@ void virReportSystemErrorFull(int domcode, 0, 0, \ _("string %s in %s must not be empty"), \ #argname, __FUNCTION__) -# define virReportInvalidPositiveArg(argname) \ +#define virReportInvalidPositiveArg(argname) \ virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \ VIR_FROM_THIS, \ VIR_ERR_INVALID_ARG, \ @@ -115,7 +114,7 @@ void virReportSystemErrorFull(int domcode, 0, 0, \ _("%s in %s must be greater than zero"), \ #argname, __FUNCTION__) -# define virReportInvalidNonZeroArg(argname) \ +#define virReportInvalidNonZeroArg(argname) \ virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \ VIR_FROM_THIS, \ VIR_ERR_INVALID_ARG, \ @@ -126,7 +125,7 @@ void virReportSystemErrorFull(int domcode, 0, 0, \ _("%s in %s must not be zero"), \ #argname, __FUNCTION__) -# define virReportInvalidZeroArg(argname) \ +#define virReportInvalidZeroArg(argname) \ virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \ VIR_FROM_THIS, \ VIR_ERR_INVALID_ARG, \ @@ -137,7 +136,7 @@ void virReportSystemErrorFull(int domcode, 0, 0, \ _("%s in %s must be zero"), \ #argname, __FUNCTION__) -# define virReportInvalidNonNegativeArg(argname) \ +#define virReportInvalidNonNegativeArg(argname) \ virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \ VIR_FROM_THIS, \ VIR_ERR_INVALID_ARG, \ @@ -148,7 +147,7 @@ void virReportSystemErrorFull(int domcode, 0, 0, \ _("%s in %s must be zero or greater"), \ #argname, __FUNCTION__) -# define virReportInvalidArg(argname, fmt, ...) \ +#define virReportInvalidArg(argname, fmt, ...) \ virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \ VIR_FROM_THIS, \ VIR_ERR_INVALID_ARG, \ @@ -159,10 +158,10 @@ void virReportSystemErrorFull(int domcode, 0, 0, \ (fmt), __VA_ARGS__) =20 -# define virReportUnsupportedError() \ +#define virReportUnsupportedError() \ virReportErrorHelper(VIR_FROM_THIS, VIR_ERR_NO_SUPPORT, \ __FILE__, __FUNCTION__, __LINE__, __FUNCTION__) -# define virReportRestrictedError(...) \ +#define virReportRestrictedError(...) \ virReportErrorHelper(VIR_FROM_THIS, VIR_ERR_OPERATION_DENIED, \ __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__) /* The sizeof(...) comparison here is a hack to catch typos @@ -170,7 +169,7 @@ void virReportSystemErrorFull(int domcode, * as detecting if you passed a typename that refers to a function * or struct type, instead of an enum. It should get optimized away * since sizeof() is known at compile time */ -# define virReportEnumRangeError(typname, value) \ +#define virReportEnumRangeError(typname, value) \ virReportErrorHelper(VIR_FROM_THIS, VIR_ERR_INTERNAL_ERROR, \ __FILE__, __FUNCTION__, __LINE__, \ "Unexpected enum value %d for %s", \ @@ -181,14 +180,14 @@ void virReportOOMErrorFull(int domcode, const char *funcname, size_t linenr); =20 -# define virReportOOMError() \ +#define virReportOOMError() \ virReportOOMErrorFull(VIR_FROM_THIS, __FILE__, __FUNCTION__, __LINE__) =20 -# define virReportError(code, ...) \ +#define virReportError(code, ...) \ virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) =20 -# define virReportErrorObject(obj) \ +#define virReportErrorObject(obj) \ virRaiseErrorObject(__FILE__, __FUNCTION__, __LINE__, obj) =20 int virSetError(virErrorPtr newerr); @@ -207,5 +206,3 @@ void virErrorPreserveLast(virErrorPtr *saveerr); void virErrorRestore(virErrorPtr *savederr); =20 VIR_DEFINE_AUTOPTR_FUNC(virError, virFreeError); - -#endif /* LIBVIRT_VIRERROR_H */ diff --git a/src/util/virerrorpriv.h b/src/util/virerrorpriv.h index 8e482f2e40..66acf0b4be 100644 --- a/src/util/virerrorpriv.h +++ b/src/util/virerrorpriv.h @@ -18,11 +18,8 @@ # error "virerrorpriv.h may only be included by virerror.c or its test sui= te" #endif /* LIBVIRT_VIRERRORPRIV_H_ALLOW */ =20 -#ifndef LIBVIRT_VIRERRORPRIV_H -# define LIBVIRT_VIRERRORPRIV_H +#pragma once =20 const char * virErrorMsg(virErrorNumber error, const char *info); - -#endif /* LIBVIRT_VIRERRORPRIV_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list