projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c9a5b03
)
Include `config.h' and only include existing files..
author
octo
<octo>
Fri, 10 Mar 2006 17:59:42 +0000
(17:59 +0000)
committer
octo
<octo>
Fri, 10 Mar 2006 17:59:42 +0000
(17:59 +0000)
src/liboping/liboping.c
patch
|
blob
|
history
src/liboping/liboping.h
patch
|
blob
|
history
diff --git
a/src/liboping/liboping.c
b/src/liboping/liboping.c
index
6f7d079
..
b57f8e2
100644
(file)
--- a/
src/liboping/liboping.c
+++ b/
src/liboping/liboping.c
@@
-17,34
+17,67
@@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
-#include <assert.h>
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stdio.h>
+# include <string.h>
+# include <errno.h>
+# include <assert.h>
+#else
+# error "You don't have the standard C99 header files installed"
+#endif /* STDC_HEADERS */
-#i
nclude <sys/types.h>
-#
include <sys/stat
.h>
-#
include <fcntl.h>
+#i
f HAVE_UNISTD_H
+#
include <unistd
.h>
+#
endif
-#include <sys/socket.h>
-#include <netdb.h>
+#if HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
-#include <netinet/in_systm.h>
-#include <netinet/in.h>
-#include <netinet/ip.h>
-#include <netinet/ip_icmp.h>
-#ifdef HAVE_NETINET_IP_VAR_H
-# include <netinet/ip_var.h>
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
#endif
#endif
-#include <netinet/ip6.h>
-#include <netinet/icmp6.h>
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+#if HAVE_NETDB_H
+# include <netdb.h>
+#endif
-#include <sys/time.h>
-#include <time.h>
+#if HAVE_NETINET_IN_SYSTM_H
+# include <netinet/in_systm.h>
+#endif
+#if HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_H
+# include <netinet/ip.h>
+#endif
+#if HAVE_NETINET_IP_ICMP_H
+# include <netinet/ip_icmp.h>
+#endif
+#ifdef HAVE_NETINET_IP_VAR_H
+# include <netinet/ip_var.h>
+#endif
+#if HAVE_NETINET_IP6_H
+# include <netinet/ip6.h>
+#endif
+#if HAVE_NETINET_ICMP6_H
+# include <netinet/icmp6.h>
+#endif
#include "liboping.h"
#include "liboping.h"
diff --git
a/src/liboping/liboping.h
b/src/liboping/liboping.h
index
73d878c
..
065ae95
100644
(file)
--- a/
src/liboping/liboping.h
+++ b/
src/liboping/liboping.h
@@
-20,8
+20,19
@@
#ifndef OCTO_PING_H
#define OCTO_PING_H 1
#ifndef OCTO_PING_H
#define OCTO_PING_H 1
-#include <stdlib.h>
-#include <unistd.h>
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
/*
* Type definitions
/*
* Type definitions