]> granicus.if.org Git - check/commitdiff
* only check for those functions that we currently need to check for
authorcpickett <cpickett@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Tue, 30 Dec 2008 01:37:21 +0000 (01:37 +0000)
committercpickett <cpickett@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Tue, 30 Dec 2008 01:37:21 +0000 (01:37 +0000)
  to solve portability problems, and avoid checking for things where
  we don't currently use the result generated in config.h
* add stubs for setenv, unsetenv, localtime_r, and fileno

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

configure.ac
lib/fileno.c [new file with mode: 0644]
lib/libcompat.h
lib/localtime_r.c [new file with mode: 0644]
lib/setenv.c [new file with mode: 0644]
lib/unsetenv.c [new file with mode: 0644]

index 364d4135178e991bd2e4156d90f22495706ca95a..1c1569df52d5676f7371ac19916620129b057fae 100644 (file)
@@ -115,13 +115,10 @@ AC_CHECK_SIZEOF(short, 2)
 AC_CHECK_SIZEOF(long, 4)
 
 # Checks for library functions.
-AC_FUNC_FORK
 AC_FUNC_MALLOC
 AC_FUNC_REALLOC
-AC_FUNC_STRFTIME
-AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([alarm gettimeofday localtime_r memmove memset putenv setenv strerror strrchr strstr])
-AC_REPLACE_FUNCS([sleep strdup strsignal])
+AC_REPLACE_FUNCS([fileno localtime_r setenv sleep strdup strsignal unsetenv])
+AC_CHECK_DECLS([fileno, localtime_r, malloc, realloc, setenv, sleep, strdup, strsignal, unsetenv])
 
 # Output files
 AC_CONFIG_HEADERS([config.h])
diff --git a/lib/fileno.c b/lib/fileno.c
new file mode 100644 (file)
index 0000000..e69de29
index f57dfa005e6802c7af814d0a11fb179f9ccc0aeb..18cd5bb01ab2ea7354038ba73460945ff8b9284e 100644 (file)
@@ -7,25 +7,41 @@
 /* defines size_t */
 #include <sys/types.h>
 
+#if !HAVE_FILENO
+int fileno(FILE *stream);
+#endif /* !HAVE_FILENO */
+
+#if !HAVE_LOCALTIME_R
+struct tm *localtime_r(const time_t *clock, struct tm *result);
+#endif /* !HAVE_LOCALTIME_R */
+
 #if !HAVE_MALLOC
-void *rpl_malloc (size_t n)
+void *rpl_malloc (size_t n);
 #endif /* !HAVE_MALLOC */
 
 #if !HAVE_REALLOC
-void *rpl_realloc (void *p, size_t n)
+void *rpl_realloc (void *p, size_t n);
 #endif /* !HAVE_REALLOC */
 
+#if !HAVE_SETENV
+int setenv(const char *name, const char *value, int overwrite);
+#endif /* !HAVE_SETENV */
+
 #if !HAVE_SLEEP
 unsigned int sleep (unsigned int seconds);
 #endif /* !HAVE_SLEEP */
 
 #if !HAVE_STRDUP
-char *strdup (const char *str)
+char *strdup (const char *str);
 #endif /* !HAVE_STRDUP */
 
 #if !HAVE_STRSIGNAL
 const char *strsignal(int sig);
 #endif /* !HAVE_STRSIGNAL */
 
+#if !HAVE_UNSETENV
+void unsetenv(const char *name);
+#endif /* !HAVE_UNSETENV */
+
 /* silence warnings about an empty library */
 void ck_do_nothing (void);
diff --git a/lib/localtime_r.c b/lib/localtime_r.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/lib/setenv.c b/lib/setenv.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/lib/unsetenv.c b/lib/unsetenv.c
new file mode 100644 (file)
index 0000000..e69de29