Browse Source

*: fix detection and usage of sys/cdefs.h

This header is non-standard (though present on many systems) and
there is no standard for what it should or should not define.

Remove it where it is not really needed. But add also a configure
check, so it can be used if available but otherwise fallback to
defining the needed macroes.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Timo Teräs 5 years ago
parent
commit
16ffb26fbb
3 changed files with 2 additions and 4 deletions
  1. 1 1
      configure.ac
  2. 1 1
      isisd/include-netbsd/iso.h
  3. 0 2
      lib/queue.h

+ 1 - 1
configure.ac

@@ -442,7 +442,7 @@ dnl Check other header files.
 dnl -------------------------
 AC_CHECK_HEADERS([stropts.h sys/ksym.h sys/times.h sys/select.h \
 	sys/types.h linux/version.h netdb.h asm/types.h \
-	sys/param.h limits.h signal.h \
+	sys/cdefs.h sys/param.h limits.h signal.h \
 	sys/socket.h netinet/in.h time.h sys/time.h])
 
 dnl Utility macro to avoid retyping includes all the time

+ 1 - 1
isisd/include-netbsd/iso.h

@@ -192,7 +192,7 @@ extern struct protosw isosw[];
 #else
 /* user utilities definitions from the iso library */
 
-#ifdef SUNOS_5
+#ifndef HAVE_SYS_CDEFS_H
 #define	__P(x)	x
 #define	__BEGIN_DECLS
 #define	__END_DECLS

+ 0 - 2
lib/queue.h

@@ -33,8 +33,6 @@
 #ifndef _SYS_QUEUE_H_
 #define	_SYS_QUEUE_H_
 
-#include <sys/cdefs.h>
-
 /*
  * This file defines four types of data structures: singly-linked lists,
  * singly-linked tail queues, lists and tail queues.