From: Wouter Wijngaards Date: Thu, 9 Feb 2012 12:40:19 +0000 (+0000) Subject: - Fix AHX_BROKEN_MEMCMP for autoheader mess up of #undef in config.h. X-Git-Tag: release-1.4.17rc1~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=388d0639bc714d5196547dcd8c9b3138009f4c41;p=thirdparty%2Funbound.git - Fix AHX_BROKEN_MEMCMP for autoheader mess up of #undef in config.h. git-svn-id: file:///svn/unbound/trunk@2610 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/acx_nlnetlabs.m4 b/acx_nlnetlabs.m4 index 3a2e35082..e90c81ea0 100644 --- a/acx_nlnetlabs.m4 +++ b/acx_nlnetlabs.m4 @@ -2,7 +2,8 @@ # Copyright 2009, Wouter Wijngaards, NLnet Labs. # BSD licensed. # -# Version 20 +# Version 21 +# 2012-02-09 Fix AHX_MEMCMP_BROKEN with undef in compat/memcmp.h. # 2012-01-20 Fix COMPILER_FLAGS_UNBOUND for gcc 4.6.2 assigned-not-used-warns. # 2011-12-05 Fix getaddrinfowithincludes on windows with fedora16 mingw32-gcc. # Fix ACX_MALLOC for redefined malloc error. @@ -1326,9 +1327,7 @@ int main(void) dnl define memcmp to its replacement, pass unique id for program as arg AC_DEFUN([AHX_MEMCMP_BROKEN], [ #ifdef MEMCMP_IS_BROKEN -# ifdef memcmp -# undef memcmp -# endif +#include "compat/memcmp.h" #define memcmp memcmp_$1 int memcmp(const void *x, const void *y, size_t n); #endif diff --git a/compat/memcmp.h b/compat/memcmp.h new file mode 100644 index 000000000..c1d195ccf --- /dev/null +++ b/compat/memcmp.h @@ -0,0 +1,16 @@ +/* + * memcmp.h: undef memcmp for compat. + * + * Copyright (c) 2012, NLnet Labs. All rights reserved. + * + * See LICENSE for the license. +*/ +#ifndef COMPAT_MEMCMP_H +#define COMPAT_MEMCMP_H + +#ifdef memcmp +/* undef here otherwise autoheader messes it up in config.h */ +# undef memcmp +#endif + +#endif /* COMPAT_MEMCMP_H */ diff --git a/config.h.in b/config.h.in index 58e15dcd0..c8c0504d4 100644 --- a/config.h.in +++ b/config.h.in @@ -825,9 +825,7 @@ struct tm *gmtime_r(const time_t *timep, struct tm *result); #ifdef MEMCMP_IS_BROKEN -# ifdef memcmp -# undef memcmp -# endif +#include "compat/memcmp.h" #define memcmp memcmp_unbound int memcmp(const void *x, const void *y, size_t n); #endif diff --git a/doc/Changelog b/doc/Changelog index d452b0e10..8321fb693 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +9 February 2012: Wouter + - Fix AHX_BROKEN_MEMCMP for autoheader mess up of #undef in config.h. + 8 February 2012: Wouter - implement draft-ietf-dnsext-ecdsa-04; which is in IETF LC; This implementation is experimental at this time and not recommended