diff options
author | delphij <delphij@FreeBSD.org> | 2015-07-15 19:21:26 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2015-07-15 19:21:26 +0000 |
commit | 2a25cee78ab1d37e7d2bc40ae675646974d99f56 (patch) | |
tree | b0302ac4be59e104f4e1e54014561a1389397192 /contrib/ntp/include/ntp_string.h | |
parent | a0741a75537b2e0514472ac3b28afc55a7846c30 (diff) | |
download | FreeBSD-src-2a25cee78ab1d37e7d2bc40ae675646974d99f56.zip FreeBSD-src-2a25cee78ab1d37e7d2bc40ae675646974d99f56.tar.gz |
MFC r280849,280915-280916,281015-281016,282097,282408,282415,283542,
284864,285169-285170,285435:
ntp 4.2.8p3.
Relnotes: yes
Approved by: re (?)
Diffstat (limited to 'contrib/ntp/include/ntp_string.h')
-rw-r--r-- | contrib/ntp/include/ntp_string.h | 43 |
1 files changed, 16 insertions, 27 deletions
diff --git a/contrib/ntp/include/ntp_string.h b/contrib/ntp/include/ntp_string.h index f7f0092..9b62ec2 100644 --- a/contrib/ntp/include/ntp_string.h +++ b/contrib/ntp/include/ntp_string.h @@ -1,13 +1,9 @@ /* - * Define string ops: strchr strrchr memcmp memmove memset + * Define string ops: strchr strrchr memcmp memmove memset */ -#ifndef _ntp_string_h -#define _ntp_string_h - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif +#ifndef NTP_STRING_H +#define NTP_STRING_H #ifdef HAVE_MEMORY_H # include <memory.h> @@ -21,28 +17,21 @@ # include <bstring.h> #endif -#ifndef STDC_HEADERS -# ifndef HAVE_STRCHR -# include <strings.h> -# define strchr index -# define strrchr rindex -# endif -# ifndef __GNUC__ -char *strchr(), *strrchr(); -# endif -# ifndef HAVE_MEMCPY -# define NTP_NEED_BOPS -# endif -#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 P((char *, int, int)); +#ifdef HAVE_STRINGS_H +# include <strings.h> /* 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 */ +#endif /* NTP_STRING_H */ |