From 489eb73f0ced8072aef8b35b74657989c893a6e4 Mon Sep 17 00:00:00 2001 From: Carsten Schoenert Date: Sat, 27 Jun 2015 19:48:42 +0200 Subject: [PATCH] i/c/*.h: remove obsolete #ifdef HAVE_* constructs The various variable checks within the public header files are not useful as such checks doesn't have to be done in these files. The public header files have only to provide the function declarations and some macro definitions, any check for the availability of needed other system header files has to be done by the user on his own. TODO: The check for syslog.h in debug.h has to be moved out of the public part into the source of the library later. --- include/coap/address.h | 18 +----------------- include/coap/coap_io.h | 12 +----------- include/coap/mem.h | 2 -- include/coap/net.h | 17 +---------------- include/coap/resource.h | 2 -- 5 files changed, 3 insertions(+), 48 deletions(-) diff --git a/include/coap/address.h b/include/coap/address.h index 05644423..426207ad 100644 --- a/include/coap/address.h +++ b/include/coap/address.h @@ -14,25 +14,9 @@ #ifndef _COAP_ADDRESS_H_ #define _COAP_ADDRESS_H_ -#ifdef HAVE_ASSERT_H #include -#else -#ifndef assert -#warning "assertions are disabled" -# define assert(x) -#endif -#endif - -#include #include - -#ifdef HAVE_NETINET_IN_H -#include -#endif - -#ifdef HAVE_NETINET_IN_H -#include -#endif +#include #ifdef WITH_LWIP #include diff --git a/include/coap/coap_io.h b/include/coap/coap_io.h index 65b66e07..3362d951 100644 --- a/include/coap/coap_io.h +++ b/include/coap/coap_io.h @@ -9,18 +9,8 @@ #ifndef _COAP_IO_H_ #define _COAP_IO_H_ -#ifdef HAVE_ASSERT_H #include -#else -#ifndef assert -#warning "assertions are disabled" -# define assert(x) -#endif -#endif - -#ifdef HAVE_SYS_TYPES_H -# include -#endif +#include #include "address.h" diff --git a/include/coap/mem.h b/include/coap/mem.h index e4ef73c1..6072ec07 100644 --- a/include/coap/mem.h +++ b/include/coap/mem.h @@ -9,9 +9,7 @@ #ifndef _COAP_MEM_H_ #define _COAP_MEM_H_ -#ifdef HAVE_STDLIB_H #include -#endif #ifndef WITH_LWIP /** diff --git a/include/coap/net.h b/include/coap/net.h index 871c3286..f50c47c1 100644 --- a/include/coap/net.h +++ b/include/coap/net.h @@ -13,26 +13,11 @@ extern "C" { #endif -#ifdef HAVE_ASSERT_H #include -#else -#ifndef assert -#warning "assertions are disabled" -# define assert(x) -#endif -#endif - #include #include -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_TIME_H -#include -#endif -#ifdef HAVE_SYS_TIME_H #include -#endif +#include #ifdef WITH_LWIP #include diff --git a/include/coap/resource.h b/include/coap/resource.h index e6a55ec4..e2c00ac3 100644 --- a/include/coap/resource.h +++ b/include/coap/resource.h @@ -14,9 +14,7 @@ #ifndef _COAP_RESOURCE_H_ #define _COAP_RESOURCE_H_ -#if defined(HAVE_ASSERT_H) && !defined(assert) # include -#endif #ifndef COAP_RESOURCE_CHECK_TIME /** The interval in seconds to check if resources have changed. */