From 5192fbc256d56cdc9e20b1cd879f1fd9ab0fad5d Mon Sep 17 00:00:00 2001 From: oetiker Date: Sun, 14 Sep 2008 20:33:30 +0000 Subject: [PATCH] added missing bottom config git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.3/program@1510 a5681a0c-68f1-0310-ab6d-d61299d08faa --- src/rrd_config_bottom.h | 236 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 236 insertions(+) create mode 100644 src/rrd_config_bottom.h diff --git a/src/rrd_config_bottom.h b/src/rrd_config_bottom.h new file mode 100644 index 0000000..ec191b9 --- /dev/null +++ b/src/rrd_config_bottom.h @@ -0,0 +1,236 @@ +#ifndef RRD_CONFIG_BOTTOM_H +#define RRD_CONFIG_BOTTOM_H + +/* make sure that we pickup the correct stuff from all headers */ +#ifdef HAVE_FEATURES_H +# ifdef _XOPEN_SOURCE +# undef _XOPEN_SOURCE +# endif +# ifdef _BSD_SOURCE +# undef _BSD_SOURCE +# endif +# define _XOPEN_SOURCE 600 +# define _BSD_SOURCE 1 +# include +#endif + +/* FreeBSD 4.8 wants this included BEFORE sys/types.h */ +#ifdef HAVE_SYS_MMAN_H +# include +#endif + +#ifdef HAVE_SYS_TYPES_H +# include +#endif + +#ifdef HAVE_SYS_PARAM_H +# include +#endif +#ifndef MAXPATH +# ifdef PATH_MAX +# define MAXPATH PATH_MAX +# endif +#endif +#ifndef MAXPATH +/* else try the BSD variant */ +# ifdef MAXPATHLEN +# define MAXPATH MAXPATHLEN +# endif +#endif + +#ifdef HAVE_ERRNO_H +# include +#endif + +#if !defined HAVE_MADVISE && defined HAVE_POSIX_MADVISE +/* use posix_madvise family */ +# define madvise posix_madvise +# define MADV_NORMAL POSIX_MADV_NORMAL +# define MADV_RANDOM POSIX_MADV_RANDOM +# define MADV_SEQUENTIAL POSIX_MADV_SEQUENTIAL +# define MADV_WILLNEED POSIX_MADV_WILLNEED +# define MADV_DONTNEED POSIX_MADV_DONTNEED +#endif +#if defined HAVE_MADVISE || defined HAVE_POSIX_MADVISE +# define USE_MADVISE 1 +#endif + +#ifdef HAVE_SYS_STAT_H +# include +#endif + +#ifdef HAVE_FCNTL_H +#include +#endif + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifdef TIME_WITH_SYS_TIME +# include +# include +#else +# ifdef HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + +#ifdef HAVE_SYS_TIMES_H +# include +#endif + +#ifdef HAVE_SYS_RESOURCE_H +# include +#if (defined(__svr4__) && defined(__sun__)) +/* Solaris headers (pre 2.6) do not have a getrusage prototype. + Use this instead. */ +extern int getrusage(int, struct rusage *); +#endif /* __svr4__ && __sun__ */ +#endif + + +/* define strrchr, strchr and memcpy, memmove in terms of bsd funcs + make sure you are NOT using bcopy, index or rindex in the code */ + +#ifdef STDC_HEADERS +# include +#else +# ifndef HAVE_STRCHR +# define strchr index +# define strrchr rindex +# endif +char *strchr (), *strrchr (); +# ifndef HAVE_MEMMOVE +# define memcpy(d, s, n) bcopy ((s), (d), (n)) +# define memmove(d, s, n) bcopy ((s), (d), (n)) +# endif +#endif + +#ifdef NO_NULL_REALLOC +# define rrd_realloc(a,b) ( (a) == NULL ? malloc( (b) ) : realloc( (a) , (b) )) +#else +# define rrd_realloc(a,b) realloc((a), (b)) +#endif + +#ifdef HAVE_STDIO_H +# include +#endif + +#ifdef HAVE_STDLIB_H +# include +#endif + +#ifdef HAVE_CTYPE_H +# include +#endif + +#ifdef HAVE_DIRENT_H +# include +# define NAMLEN(dirent) strlen((dirent)->d_name) +#else +# define dirent direct +# define NAMLEN(dirent) (dirent)->d_namlen +# ifdef HAVE_SYS_NDIR_H +# include +# endif +# ifdef HAVE_SYS_DIR_H +# include +# endif +# ifdef HAVE_NDIR_H +# include +# endif +#endif + +#ifdef MUST_DISABLE_SIGFPE +# include +#endif + +#ifdef MUST_DISABLE_FPMASK +# include +#endif + + +#ifdef HAVE_MATH_H +# include +#endif + +#ifdef HAVE_FLOAT_H +# include +#endif + +#ifdef HAVE_IEEEFP_H +# include +#endif + +#ifdef HAVE_FP_CLASS_H +# include +#endif + +/* for Solaris */ +#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS)) +# define HAVE_ISINF 1 +# ifdef isinf +# undef isinf +# endif +# define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF) +#endif + +/* solaris 10 it defines isnan such that only forte can compile it ... bad bad */ +#if (defined(HAVE_ISNAN) && defined(isnan) && defined(HAVE_FPCLASS)) +# undef isnan +# define isnan(a) (fpclass(a) == FP_SNAN || fpclass(a) == FP_QNAN) +#endif + +/* for OSF1 Digital Unix */ +#if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H)) +# define HAVE_ISINF 1 +# define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF) +#endif + +#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF)) +# define HAVE_ISINF 1 +# define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF) +#endif + +#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE)) +# define HAVE_ISINF 1 +# define isinf(a) (fpclassify(a) == FP_INFINITE) +#endif + +/* for AIX */ +#if (! defined(HAVE_ISINF) && defined(HAVE_CLASS)) +# define HAVE_ISINF 1 +# define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF) +#endif + +#if (! defined (HAVE_FINITE) && defined (HAVE_ISFINITE)) +# define HAVE_FINITE 1 +# define finite(a) isfinite(a) +#endif + +#if (! defined(HAVE_FINITE) && defined(HAVE_ISNAN) && defined(HAVE_ISINF)) +# define HAVE_FINITE 1 +# define finite(a) (! isnan(a) && ! isinf(a)) +#endif + +#ifndef HAVE_FINITE +#error "Can't compile without finite function" +#endif + +#ifndef HAVE_ISINF +#error "Can't compile without isinf function" +#endif + +#if (! defined(HAVE_FDATASYNC) && defined(HAVE_FSYNC)) +#define fdatasync fsync +#endif + +#if (!defined(HAVE_FDATASYNC) && !defined(HAVE_FSYNC)) +#error "Can't compile with without fsync and fdatasync" +#endif + +#endif /* RRD_CONFIG_BOTTOM_H */ + -- 2.30.2