]> granicus.if.org Git - check/commitdiff
libcompat: remove fileno() replacement
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Wed, 25 Dec 2013 03:05:06 +0000 (03:05 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Wed, 25 Dec 2013 03:05:06 +0000 (03:05 +0000)
fileno() is no longer necessary, as pipe IO is now
handled with FILE API.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@968 64e312b2-a51f-0410-8e61-82d0ca0eb02a

CMakeLists.txt
configure.ac
lib/CMakeLists.txt
lib/fileno.c [deleted file]
lib/libcompat.h

index 1e787f21a56be9766c246640dcc4bb1ca233cb72..39961b2f5d581ffa327c60df61e1db30bddcf204 100644 (file)
@@ -126,7 +126,6 @@ ck_check_include_file("winioctl.h" HAVE_WINIOCTL_H)
 # Check functions
 check_function_exists(ctime_r HAVE_CTIME_R)
 check_function_exists(fcntl HAVE_FCNTL)
-check_function_exists(fileno HAVE_DECL_FILENO)
 check_function_exists(fork HAVE_FORK)
 check_function_exists(fstat HAVE_FSTAT)
 check_function_exists(getenv HAVE_GETENV)
@@ -174,7 +173,6 @@ check_function_exists(wctomb HAVE_WCTOMB)
 check_function_exists(wmemcmp HAVE_WMEMCMP)
 check_function_exists(wmemcpy HAVE_WMEMCPY)
 check_function_exists(_ctime64_s HAVE__CTIME64_S)
-check_function_exists(_fileno HAVE__FILENO)
 check_function_exists(_fseeki64 HAVE__FSEEKI64)
 check_function_exists(_get_timezone HAVE__GET_TIMEZONE)
 check_function_exists(_getpid HAVE__GETPID)
index 35a88bb301fef73f525f857c2b49d44c42c0544f..6043ddb9889de131cb41d6a11e4b53ddfcf34cf1 100644 (file)
@@ -251,8 +251,8 @@ AC_FUNC_REALLOC
 # replaced with Check's replacement of these functions.
 HW_LIBRT_TIMERS
 
-AC_REPLACE_FUNCS([alarm clock_gettime gettimeofday fileno localtime_r putenv setenv sleep strdup strsignal unsetenv])
-AC_CHECK_DECLS([alarm, clock_gettime, gettimeofday, fileno, localtime_r, putenv, setenv, sleep, strdup, strsignal, unsetenv])
+AC_REPLACE_FUNCS([alarm clock_gettime gettimeofday localtime_r putenv setenv sleep strdup strsignal unsetenv])
+AC_CHECK_DECLS([alarm, clock_gettime, gettimeofday, localtime_r, putenv, setenv, sleep, strdup, strsignal, unsetenv])
 
 AC_CHECK_FUNCS([setitimer])
 
index 5082d801290e95038d6aebf1a4cb48e44757df6b..04fe7039ede94f7624932af92602feac35f7e3d5 100644 (file)
@@ -28,10 +28,6 @@ if (NOT HAVE_LIBRT)
   set(SOURCES ${SOURCES} timer_settime.c)
 endif(NOT HAVE_LIBRT)
 
-if(NOT HAVE_DECL_FILENO AND NOT HAVE__FILENO)
-  set(SOURCES ${SOURCES} fileno.c)
-endif(NOT HAVE_DECL_FILENO AND NOT HAVE__FILENO)
-
 if(NOT HAVE_GETTIMEOFDAY)
   set(SOURCES ${SOURCES} gettimeofday.c)
 endif(NOT HAVE_GETTIMEOFDAY)
diff --git a/lib/fileno.c b/lib/fileno.c
deleted file mode 100644 (file)
index bb142de..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "libcompat.h"
-
-int fileno(FILE *stream CK_ATTRIBUTE_UNUSED)
-{
-    assert (0);
-    return 0;
-}
index ee8a7a3be34dfa498cef980a0f906f1d49d65041..0b4b53ec2be4351db7996e42fd461e70762d0a85 100644 (file)
@@ -83,13 +83,6 @@ void *rpl_malloc (size_t n);
 void *rpl_realloc (void *p, size_t n);
 #endif /* !HAVE_REALLOC */
 
-/* functions that may be undeclared */
-#if !HAVE_DECL_FILENO && !HAVE__FILENO
-int fileno (FILE *stream);
-#elif !HAVE_FILENO && HAVE__FILENO
-#define fileno _fileno;
-#endif /* !HAVE_DECL_FILENO && !HAVE__FILENO */
-
 #if !HAVE_GETPID && HAVE__GETPID
 #define getpid _getpid;
 #endif /* !HAVE_GETPID && HAVE__GETPID */