From: Enrico Scholz Date: Wed, 24 Mar 2004 01:07:53 +0000 (+0000) Subject: placed a 'do ... while (0)' block around the macros X-Git-Tag: VERSION_0_10~251 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8465369ffc25b9c599a8e5215abe44b7d6600453;p=util-vserver.git 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 --- 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