From: cpickett Date: Wed, 31 Dec 2008 03:01:37 +0000 (+0000) Subject: * move #include and to libcompat.h X-Git-Tag: 0.10.0~663 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c666ca816849edbc0d307e836b6e90ac96457a8e;p=check * move #include and to libcompat.h git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@501 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- diff --git a/lib/libcompat.h b/lib/libcompat.h index f9d8ecd..4f14c3e 100644 --- a/lib/libcompat.h +++ b/lib/libcompat.h @@ -25,6 +25,19 @@ /* defines FILE */ #include +/* declares fork(), _POSIX_VERSION. according to Autoconf.info, + unistd.h defines _POSIX_VERSION if the system is POSIX-compliant, + so we will use this as a test for all things uniquely provided by + POSIX like sigaction() and fork() */ +#ifdef HAVE_UNISTD_H +#include +#endif + +/* declares pthread_create and friends */ +#ifdef HAVE_PTHREAD +#include +#endif + /* replacement functions for broken originals */ #if !HAVE_MALLOC void *rpl_malloc (size_t n); diff --git a/src/check_msg.c b/src/check_msg.c index c2214cc..9ec44cd 100644 --- a/src/check_msg.c +++ b/src/check_msg.c @@ -22,7 +22,6 @@ #include "../lib/libcompat.h" #include -#include #include #include #include diff --git a/src/check_pack.c b/src/check_pack.c index d2fd757..2c9acf5 100644 --- a/src/check_pack.c +++ b/src/check_pack.c @@ -25,18 +25,10 @@ #include #include -#ifdef HAVE_UNISTD_H -#include -#endif - #ifdef HAVE_STDINT_H #include #endif -#ifdef HAVE_PTHREAD -#include -#endif - #include "check.h" #include "check_error.h" #include "check_list.h" diff --git a/src/check_run.c b/src/check_run.c index c1876cb..27fb377 100644 --- a/src/check_run.c +++ b/src/check_run.c @@ -25,10 +25,6 @@ #ifdef HAVE_SYS_WAIT_H #include #endif -/* according to Autoconf.info, unistd.h defines _POSIX_VERSION if the - system is POSIX-compliant, so we will use this as a test for all - things provided by POSIX like sigaction() and fork(). */ -#include #include #include #include diff --git a/tests/check_check_fork.c b/tests/check_check_fork.c index 631f8be..447e44d 100644 --- a/tests/check_check_fork.c +++ b/tests/check_check_fork.c @@ -1,7 +1,6 @@ #include "../lib/libcompat.h" #include -#include #include #include #include "check_check.h" diff --git a/tests/check_check_pack.c b/tests/check_check_pack.c index 21f06f0..898ec29 100644 --- a/tests/check_check_pack.c +++ b/tests/check_check_pack.c @@ -3,7 +3,6 @@ #include #include #include -#include #include "check.h" #include "check_pack.h" diff --git a/tests/check_check_sub.c b/tests/check_check_sub.c index f9b0b1b..8a6cca5 100644 --- a/tests/check_check_sub.c +++ b/tests/check_check_sub.c @@ -4,7 +4,6 @@ #if HAVE_SYS_WAIT_H #include #endif /* HAVE_SYS_WAIT_H */ -#include #include #include #include diff --git a/tests/check_thread_stress.c b/tests/check_thread_stress.c index b8ff678..80a53d5 100644 --- a/tests/check_thread_stress.c +++ b/tests/check_thread_stress.c @@ -6,15 +6,6 @@ #include #include -/* fork() */ -#ifdef HAVE_UNISTD_H -#include -#endif - -#ifdef HAVE_PTHREAD -#include -#endif - Suite *s; TCase *tc; SRunner *sr;