#define isc_mem_strdup(c, str) \
( ISC_MEM_UNUSED_ARG(c), estrdup(str) )
-#define isc_mem_attach(src, ptgt) do { *(ptgt) = (src); } while (0)
-#define isc_mem_detach(c) ISC_MEM_UNUSED_ARG(c)
-#define isc_mem_printallactive(s) fprintf((s), \
+#define isc__mem_attach(src, ptgt) do { *(ptgt) = (src); } while (0)
+#define isc__mem_detach(c) ISC_MEM_UNUSED_ARG(c)
+#define isc__mem_printallactive(s) fprintf((s), \
"isc_mem_printallactive() stubbed.\n")
#endif /* ISC_MEM_H */
#include "ntp_syslog.h"
-/*
- * #define away gcc __attribute__ if unavailable.
- */
-#ifndef __attribute__
- /* This feature is available in gcc versions 2.5 and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || (defined(__STRICT_ANSI__))
-# define __attribute__(Spec) /* empty */
-# endif
- /*
- * The __-protected variants of `format' and `printf' attributes are
- * accepted by gcc versions 2.6.4 (effectively 2.7) and later.
- */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
-# define __format__ format
-# define __printf__ printf
-# define __noreturn__ noreturn
-# endif
-#endif
-
extern int mprintf(const char *, ...)
__attribute__((__format__(__printf__, 1, 2)));
extern int mfprintf(FILE *, const char *, ...)
* Forward.
*/
static void
-default_callback(const char *, int, isc_assertiontype_t, const char *)
- __attribute__ ((__noreturn__));
+default_callback(const char *, int, isc_assertiontype_t, const char *);
static isc_assertioncallback_t isc_assertion_failed_cb = default_callback;
#include <isc/lang.h>
#include <isc/platform.h>
-/*
- * #define away gcc __attribute__ if unavailable.
- */
-#ifndef __attribute__
- /* This feature is available in gcc versions 2.5 and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || (defined(__STRICT_ANSI__))
-# define __attribute__(Spec) /* empty */
-# endif
- /*
- * The __-protected variants of `format' and `printf' attributes are
- * accepted by gcc versions 2.6.4 (effectively 2.7) and later.
- */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
-# define __format__ format
-# define __printf__ printf
-# define __noreturn__ noreturn
-# endif
-#endif
-
ISC_LANG_BEGINDECLS
/*% isc assertion type */
} isc_assertiontype_t;
typedef void (*isc_assertioncallback_t)(const char *, int, isc_assertiontype_t,
- const char *)
- __attribute__ ((__noreturn__));
+ const char *);
/* coverity[+kill] */
ISC_PLATFORM_NORETURN_PRE
if (result != ISC_R_SUCCESS)
goto cleanup_mgr;
LOCK(&manager->lock);
- manager->magic = TASK_MANAGER_MAGIC;
- manager->mctx = NULL;
#ifdef USE_WORKER_THREADS
manager->workers = 0;
linux_if_inet6_current(isc_interfaceiter_t *iter) {
char address[33];
char name[IF_NAMESIZE+1];
- char strbuf[ISC_STRERRORSIZE];
struct in6_addr addr6;
unsigned int ifindex;
int prefix, scope, flags;
- struct ifreq ifreq;
int res;
unsigned int i;
addr6.s6_addr[i] = byte;
}
iter->current.af = AF_INET6;
- iter->current.flags = 0;
- memset(&ifreq, 0, sizeof(ifreq));
- INSIST(sizeof(ifreq.ifr_name) <= sizeof(iter->current.name));
- strncpy(ifreq.ifr_name, name, sizeof(ifreq.ifr_name));
-
- if (ioctl(iter->socket, SIOCGIFFLAGS, (char *) &ifreq) < 0) {
- isc__strerror(errno, strbuf, sizeof(strbuf));
- UNEXPECTED_ERROR(__FILE__, __LINE__,
- "%s: getting interface flags: %s",
- ifreq.ifr_name, strbuf);
- return (ISC_R_IGNORE);
- }
-
- if ((ifreq.ifr_flags & IFF_UP) != 0)
- iter->current.flags |= INTERFACE_F_UP;
-#ifdef IFF_POINTOPOINT
- if ((ifreq.ifr_flags & IFF_POINTOPOINT) != 0)
- iter->current.flags |= INTERFACE_F_POINTTOPOINT;
-#endif
- if ((ifreq.ifr_flags & IFF_LOOPBACK) != 0)
- iter->current.flags |= INTERFACE_F_LOOPBACK;
- if ((ifreq.ifr_flags & IFF_BROADCAST) != 0)
- iter->current.flags |= INTERFACE_F_BROADCAST;
-#ifdef IFF_MULTICAST
- if ((ifreq.ifr_flags & IFF_MULTICAST) != 0)
- iter->current.flags |= INTERFACE_F_MULTICAST;
-#endif
-
+ iter->current.flags = INTERFACE_F_UP;
isc_netaddr_fromin6(&iter->current.address, &addr6);
iter->current.ifindex = ifindex;
if (isc_netaddr_islinklocal(&iter->current.address)) {
libisc_SRCS = \
$(srcdir)/../lib/isc/assertions.c \
$(srcdir)/../lib/isc/buffer.c \
+ $(srcdir)/../lib/isc/backtrace-emptytbl.c \
+ $(srcdir)/../lib/isc/backtrace.c \
$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c \
$(srcdir)/../lib/isc/unix/dir.c \
$(srcdir)/../lib/isc/error.c \
#ifndef VSNPRINTF_PERCENT_M
void format_errmsg (char *, size_t, const char *, int);
-/*
- * Work around misdetection by AC_FUNC_STRERROR_R on Debian Linux.
- */
-# if defined(STRERROR_R_CHAR_P) && strerror_r == __xpg_strerror_r
-# undef STRERROR_R_CHAR_P
-# endif
-
-
/* format_errmsg() is under #ifndef VSNPRINTF_PERCENT_M above */
void
format_errmsg(
buf[0] = '\0';
# ifdef STRERROR_R_CHAR_P
- /*
- * For older GNU strerror_r, the return value either points to
- * buf, or to static storage. We want the result always in buf.
- * On Debian Linux 6.03 with gcc 4.4, strerror_r() returns an
- * int despite configure detecting STRERROR_R_CHAR_P. We are
- * careful with the result, but need to cast to (char *) to
- * silence gcc on Debian 6.03.
- */
- pstatic = (char *)strerror_r(err, buf, bufsiz);
+ pstatic = strerror_r(err, buf, bufsiz);
# else
pstatic = strerror(err);
# endif
#define _WIN32_WINNT 0x0501
#endif
-
+#define __attribute__(x) /* empty */
#define _CRT_SECURE_NO_DEPRECATE 1
+
/*
* ANSI C compliance enabled
*/
RelativePath="..\..\..\lib\isc\buffer.c"
>
</File>
+ <File
+ RelativePath="..\..\..\lib\isc\backtrace-emtpytbl.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\backtrace.c"
+ >
+ </File>
<File
RelativePath="..\..\..\libntp\buftvtots.c"
>
RelativePath="..\..\..\..\libntp\authusekey.c"
>
</File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\backtrace-emptytbl.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\backtrace.c"
+ >
+ </File>
<File
RelativePath="..\..\..\..\lib\isc\buffer.c"
>
>
</File>
<File
- RelativePath="..\..\..\..\lib\isc\win32\include\isc\time.h"
+ RelativePath="..\..\include\sys\time.h"
>
</File>
<File
- RelativePath="..\..\include\sys\time.h"
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\time.h"
>
</File>
<File
[Should we avoid @%:@warning on option name collisions?])
esac
+AC_CACHE_CHECK(
+ [if $CC supports __attribute__((...))],
+ [ntp_cv_cc_attribute],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[]],
+ [[void foo(void) __attribute__((__noreturn__));]]
+ )],
+ [ntp_cv_cc_attribute=yes],
+ [ntp_cv_cc_attribute=no]
+ )]
+)
+case "$ntp_cv_cc_attribute" in
+ yes)
+ AC_DEFINE([HAVE___ATTRIBUTE__], [],
+ [defined if C compiler supports __attribute__((...))])
+esac
+AH_VERBATIM(
+ [HAVE___ATTRIBUTE___VERBATIM],
+ [
+ /* define away __attribute__() if unsupported */
+ #ifndef HAVE___ATTRIBUTE__
+ # define __attribute__(x) /* empty */
+ #endif
+ #define ISC_PLATFORM_NORETURN_PRE
+ #define ISC_PLATFORM_NORETURN_POST __attribute__((__noreturn__))
+ ]
+)
+
case "$GCC" in
yes)
SAVED_CFLAGS="$CFLAGS"
[getifaddrs],
[AS_HELP_STRING(
[--enable-getifaddrs],
- [s Enable the use of getifaddrs() [[yes|no|glibc]].
-glibc: Use getifaddrs() in glibc if you know it supports IPv6.]
+ [+ Enable the use of getifaddrs() [[yes|no]].]
)],
[want_getifaddrs="$enableval"],
[want_getifaddrs="yes"]
)
case $want_getifaddrs in
- yes|glibc)
- #
- # Do we have getifaddrs() ?
- #
- case $host in
- *-*linux*)
- # Some recent versions of glibc support getifaddrs() which does not
- # provide AF_INET6 addresses while the function provided by the USAGI
- # project handles the AF_INET6 case correctly. We need to avoid
- # using the former but prefer the latter unless overridden by
- # --enable-getifaddrs=glibc.
- case "$want_getifaddrs" in
- glibc)
- AC_CHECK_FUNCS([getifaddrs])
- ;;
- *)
- save_LIBS="$LIBS"
- LIBS="-L/usr/local/v6/lib $LIBS"
- AC_CHECK_LIB(
- [inet6],
- [getifaddrs],
- [ans=yes],
- [ans=no]
- )
- case "$ans" in
- yes)
- LIBS="$LIBS -linet6"
- AC_DEFINE([HAVE_GETIFADDRS], [1])
- ;;
- *)
- LIBS=${save_LIBS}
- ;;
- esac
- ;;
- esac
- ;;
- esac
+ no)
+ ;;
+ glibc)
+ AC_MSG_WARN([--enable-getifaddrs=glibc is no longer required])
+ AC_CHECK_FUNCS([getifaddrs])
;;
*)
AC_CHECK_FUNCS([getifaddrs])
hw_force_rpl_snprintf=yes
hw_force_rpl_vsnprintf=yes
esac
- AH_TOP([
- #if !defined(_KERNEL) && !defined(PARSESTREAM)
- # include <stdio.h> /* before #define vsnprintf rpl_... */
- #endif
+ AH_VERBATIM(
+ [snprinte],dnl sorted in config.h just before #define snprintf
+ [
+ #if !defined(_KERNEL) && !defined(PARSESTREAM)
+ /*
+ * stdio.h must be included after _GNU_SOURCE is defined
+ * but before #define snprintf rpl_snprintf
+ */
+ # include <stdio.h>
+ #endif
])
AH_BOTTOM([
#if !defined(_KERNEL) && !defined(PARSESTREAM)