From 8465369ffc25b9c599a8e5215abe44b7d6600453 Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Wed, 24 Mar 2004 01:07:53 +0000 Subject: [PATCH] placed a 'do ... while (0)' block around the macros git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@1324 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/lib_internal/util-perror.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util-vserver/lib_internal/util-perror.h b/util-vserver/lib_internal/util-perror.h index a3d9022..4f516f5 100644 --- a/util-vserver/lib_internal/util-perror.h +++ b/util-vserver/lib_internal/util-perror.h @@ -19,7 +19,7 @@ #ifndef H_UTIL_VSERVER_LIB_INTERNAL_UTIL_PERROR_H #define H_UTIL_VSERVER_LIB_INTERNAL_UTIL_PERROR_H -#define PERROR_U(MSG, ARG0) { \ +#define PERROR_U(MSG, ARG0) do { \ size_t pu_l1 = strlen(MSG); \ size_t pu_l2 = strlen(ARG0); \ char pu_buf[pu_l1 + pu_l2 + sizeof("()")]; \ @@ -29,9 +29,9 @@ pu_buf[pu_l1+1+pu_l2] = ')'; \ pu_buf[pu_l1+2+pu_l2] = '\0'; \ perror(pu_buf); \ - } + } while (0) -#define PERROR_Q(MSG, ARG0) { \ +#define PERROR_Q(MSG, ARG0) do { \ size_t pq_l = strlen(ARG0); \ char pq_buf[pq_l + 3]; \ pq_buf[0] = '"'; \ @@ -39,6 +39,6 @@ pq_buf[pq_l+1] = '"'; \ pq_buf[pq_l+2] = '\0'; \ PERROR_U(MSG, pq_buf); \ - } + } while (0) #endif // H_UTIL_VSERVER_LIB_INTERNAL_UTIL_PERROR_H -- 1.8.1.5