Make more header inclusions conditional on whether they exist.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18715 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming
2010-02-24 17:38:14 +00:00
parent 78595343b2
commit 28d296d96d
4 changed files with 33 additions and 10 deletions

View File

@@ -105,7 +105,7 @@ AC_PROG_MAKE_SET
AC_PROG_LN_S
AC_HEADER_STDC
AC_CHECK_HEADERS(limits.h sys/times.h sys/wait.h)
AC_CHECK_HEADERS(limits.h sys/time.h sys/times.h sys/wait.h)
AC_CHECK_FUNCS(stpcpy memcpy timegm towupper)
AC_CHECK_FUNCS(setenv,,[
AC_CHECK_FUNCS(putenv,,[
@@ -248,7 +248,7 @@ else
AC_MSG_RESULT(no)
fi
AC_CHECK_HEADERS(dlfcn.h dl.h utmp.h locale.h mcheck.h unistd.h wctype.h)
AC_CHECK_HEADERS(dirent.h dlfcn.h dl.h utmp.h locale.h mcheck.h unistd.h wctype.h)
# Gnucash replaced dlopen/dlsym by the g_module functions; dlsym
# is needed optionally in one place for BSD linkers, though.

View File

@@ -29,7 +29,9 @@
# include <sys/types.h>
#endif
#include <ctype.h>
#include <dirent.h>
#ifdef HAVE_DIRENT_H
# include <dirent.h>
#endif
#include <glib.h>
#include <glib/gstdio.h>
#include <stdlib.h>
@@ -39,7 +41,9 @@
# include <sys/times.h>
#endif
#include <time.h>
#include <unistd.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "qof.h"
#include "md5.h"
@@ -373,7 +377,8 @@ guid_init(void)
/* process and parent ids */
{
pid_t pid;
#ifdef HAVE_UNISTD_H
pid_t pid;
pid = getpid();
md5_process_bytes(&pid, sizeof(pid), &guid_context);
@@ -384,7 +389,8 @@ guid_init(void)
md5_process_bytes(&pid, sizeof(pid), &guid_context);
bytes += sizeof(pid);
#endif
}
#endif
}
/* user info */
{

View File

@@ -30,14 +30,25 @@
#include <glib.h>
#include <glib/gstdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#else
#warning unistd required.
# ifdef __GNUC__
# warning "<unistd.h> required."
# endif
#endif
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#else
/* We simply define the struct timeval on our own here. */
struct timeval {
long tv_sec; /* seconds */
long tv_usec; /* and microseconds */
};
/* include <Winsock2.h> */
#endif
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "qof.log"

View File

@@ -37,7 +37,13 @@
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#else
# ifdef __GNUC__
# warning "<unistd.h> required."
# endif
#endif
#include <glib.h>
#include "qof.h"