From: Dave Hart Date: Sun, 3 May 2009 05:08:34 +0000 (+0000) Subject: ../../libparse/parse.c:211: warning: implicit declaration of function 'bcopy' X-Git-Tag: NTP_4_2_5P171~3^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=911b0c9969830d4bde08e9c4eb3a7fec68be7aa2;p=thirdparty%2Fntp.git ../../libparse/parse.c:211: warning: implicit declaration of function 'bcopy' ../../libparse/parse.c:211: warning: incompatible implicit declaration of built- in function 'bcopy' #include in ntp_lineedit.c which uses free() bk: 49fd26d2_1wAkHMQ4yPK7ckHpA-twQ --- diff --git a/configure.ac b/configure.ac index 14e3f7832..d01ac6e09 100644 --- a/configure.ac +++ b/configure.ac @@ -3292,6 +3292,7 @@ case "$ntp_parseutil$ac_cv_header_sys_stropts_h" in sparc-*-solaris2*) ans=parsesolaris MAKE_PARSEKMODULE=parse + AC_CHECK_HEADERS([strings.h]) ;; esac ;; diff --git a/include/ntp_string.h b/include/ntp_string.h index 17163b053..aab7084b0 100644 --- a/include/ntp_string.h +++ b/include/ntp_string.h @@ -36,13 +36,20 @@ char *strchr(), *strrchr(); #endif /* STDC_HEADERS */ #ifdef NTP_NEED_BOPS -# define memcmp(a,b,c) bcmp(a,b,(int)c) -# define memmove(t,f,c) bcopy(f,t,(int)c) -# define memcpy(t,f,c) bcopy(f,t,(int)c) -# define memset(a,x,c) if (x == 0x00) bzero(a,(int)c); else ntp_memset((char*)a,x,c) -void ntp_memset (char *, int, int); +#ifdef HAVE_STRINGS_H +# include /* bcmp, bcopy, bzero */ +#endif + +void ntp_memset (char *, int, int); +#define memcmp(a, b, c) bcmp(a, b, (int)(c)) +#define memmove(t, f, c) bcopy(f, t, (int)(c)) +#define memcpy(t, f, c) bcopy(f, t, (int)(c)) +#define memset(a, x, c) if (0 == (x)) \ + bzero(a, (int)(c)); \ + else \ + ntp_memset((char *)(a), x, c) #endif /* NTP_NEED_BOPS */ #endif /* _ntp_string_h */ diff --git a/libntp/ntp_lineedit.c b/libntp/ntp_lineedit.c index aa402308f..70b54f97c 100644 --- a/libntp/ntp_lineedit.c +++ b/libntp/ntp_lineedit.c @@ -7,6 +7,7 @@ #include #include +#include #include #if defined(HAVE_READLINE_HISTORY)