8000 Avoid warning. · log4cplus/log4cplus@4529e68 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4529e68

Browse files
committed
Avoid warning.
Rearrange loop around `sem_wait()` to avoid "embedding a directive within macro arguments is not portable" warning.
1 parent 6b91a7d commit 4529e68

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

include/log4cplus/thread/impl/syncprims-pthreads.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,12 @@ void
246246
Semaphore::lock () const
247247 8000
{
248248
int ret;
249-
while (LOG4CPLUS_UNLIKELY ((
249+
while (
250250
#if defined (LOG4CPLUS_USE_NAMED_POSIX_SEMAPHORE)
251-
ret = sem_wait (sem)
251+
LOG4CPLUS_UNLIKELY ((ret = sem_wait (sem)) == -1)
252252
#else
253-
ret = sem_wait (&sem)
253+
LOG4CPLUS_UNLIKELY ((ret = sem_wait (&sem)) == -1)
254254
#endif
255-
) == -1)
256255
&& errno == EINTR)
257256
{ /* try again after signal */ }
258257

0 commit comments

Comments
 (0)
0