From: cpickett Date: Tue, 30 Dec 2008 06:21:44 +0000 (+0000) Subject: * add pipe(2) stub X-Git-Tag: 0.10.0~674 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eaafaa20c04f0b40520a9a3f4f67ec670ba1d22d;p=check * add pipe(2) stub - now both src/ and tests/ compile and link properly on MSYS/MinGW! git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@490 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- diff --git a/configure.ac b/configure.ac index de46d9d..1c18641 100644 --- a/configure.ac +++ b/configure.ac @@ -117,8 +117,8 @@ AC_CHECK_SIZEOF(long, 4) # Checks for library functions. AC_FUNC_MALLOC AC_FUNC_REALLOC -AC_REPLACE_FUNCS([fileno localtime_r putenv setenv sleep strdup strsignal unsetenv]) -AC_CHECK_DECLS([fileno, localtime_r, putenv, setenv, sleep, strdup, strsignal, unsetenv]) +AC_REPLACE_FUNCS([fileno localtime_r pipe putenv setenv sleep strdup strsignal unsetenv]) +AC_CHECK_DECLS([fileno, localtime_r, pipe, putenv, setenv, sleep, strdup, strsignal, unsetenv]) # Output files AC_CONFIG_HEADERS([config.h]) diff --git a/lib/libcompat.h b/lib/libcompat.h index a8b8b2d..f9d8ecd 100644 --- a/lib/libcompat.h +++ b/lib/libcompat.h @@ -43,8 +43,12 @@ int fileno (FILE *stream); struct tm *localtime_r (const time_t *clock, struct tm *result); #endif /* !HAVE_DECL_LOCALTIME_R */ +#if !HAVE_DECL_PIPE +int pipe (int *fildes); +#endif /* !HAVE_DECL_PIPE */ + #if !HAVE_DECL_PUTENV -int putenv (const char *string CK_ATTRIBUTE_UNUSED); +int putenv (const char *string); #endif /* !HAVE_DECL_PUTENV */ #if !HAVE_DECL_SETENV diff --git a/lib/pipe.c b/lib/pipe.c new file mode 100644 index 0000000..3859a51 --- /dev/null +++ b/lib/pipe.c @@ -0,0 +1,7 @@ +#include "libcompat.h" + +int +pipe (int *fildes CK_ATTRIBUTE_UNUSED) +{ + return 0; +}