Fix gc.h compliance to strict ANSI (pthreads)
authorIvan Maidanski <ivmai@mail.ru>
Thu, 30 Mar 2017 21:11:04 +0000 (00:11 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 30 Mar 2017 21:11:04 +0000 (00:11 +0300)
commit15542970281433925942efc111dd895652e569f7
tree04e11635974274fc86c26e738ac8759c4cd4a8df
parentb15c34355fb42d785b8aa1cc5c6e337a99b50645
Fix gc.h compliance to strict ANSI (pthreads)

If -std=cXX option is passed to gcc/clang then sigset_t is undefined,
thus GC_pthread_sigmask declaration should be omitted.  However, this
symbol should be available during GC source code audit by cppcheck.

* include/gc_pthread_redirects.h [!GC_NO_PTHREAD_SIGMASK]
(GC_pthread_sigmask): Declare only if GC_PTHREAD_SIGMASK_NEEDED or
_POSIX_C_SOURCE >= 199506 or _XOPEN_SOURCE >= 500.
* tests/test.c [CPPCHECK] (GC_PTHREAD_SIGMASK_NEEDED): Define (before
include gc.h).
* tests/test.c [CPPCHECK && !_GNU_SOURCE] (_GNU_SOURCE): Likewise.
include/gc_pthread_redirects.h
tests/test.c