Subject: [PATCH 1/3] Replace __BEGIN_DECLS and __END_DECLS
 
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
 ---
 Upstream-Status: Pending
 
  include/bsd/nlist.h          | 10 ++++++++--
  include/bsd/readpassphrase.h | 10 ++++++++--
  include/bsd/stdio.h          | 10 ++++++++--
- include/bsd/stdlib.h         | 10 ++++++++--
- include/bsd/string.h         | 10 ++++++++--
+ include/bsd/stdlib.h         | 12 +++++++++---
+ include/bsd/string.h         | 12 +++++++++---
  include/bsd/stringlist.h     | 10 ++++++++--
  include/bsd/unistd.h         | 10 ++++++++--
  include/bsd/vis.h            | 10 ++++++++--
  include/bsd/wchar.h          | 10 ++++++++--
  src/hash/sha512.h            | 10 ++++++++--
- 13 files changed, 104 insertions(+), 26 deletions(-)
+ 13 files changed, 106 insertions(+), 28 deletions(-)
 
 diff --git a/include/bsd/err.h b/include/bsd/err.h
 index 12fd051..43dfc32 100644
  
  #endif
 diff --git a/include/bsd/libutil.h b/include/bsd/libutil.h
-index ebb6160..28b919d 100644
+index 45b3b15..9c936e5 100644
 --- a/include/bsd/libutil.h
 +++ b/include/bsd/libutil.h
 @@ -53,7 +53,10 @@ struct pidfh {
  /* humanize_number(3) */
  #define HN_DECIMAL              0x01
 diff --git a/include/bsd/md5.h b/include/bsd/md5.h
-index 9a75fad..3531fd6 100644
+index 5f3ae46..5d80e5c 100644
 --- a/include/bsd/md5.h
 +++ b/include/bsd/md5.h
 @@ -30,7 +30,10 @@ typedef struct MD5Context {
 +#endif
 +/* __END_DECLS */
  
- #endif /* _MD5_H_ */
+ #endif /* LIBBSD_MD5_H */
 diff --git a/include/bsd/nlist.h b/include/bsd/nlist.h
-index 2730237..0389ab7 100644
+index cb297e8..e63bbbd 100644
 --- a/include/bsd/nlist.h
 +++ b/include/bsd/nlist.h
-@@ -30,8 +30,14 @@
- #include <sys/cdefs.h>
- #include <a.out.h>
+@@ -88,8 +88,14 @@ struct nlist {
+ 
+ #define N_FORMAT      "%08x"  /* namelist value format; XXX */
  
 -__BEGIN_DECLS
 +/* __BEGIN_DECLS */
  
  #endif
 diff --git a/include/bsd/readpassphrase.h b/include/bsd/readpassphrase.h
-index e1dacc3..76e0d33 100644
+index 14744b8..fa73361 100644
 --- a/include/bsd/readpassphrase.h
 +++ b/include/bsd/readpassphrase.h
 @@ -34,8 +34,14 @@
 +#endif
 +/* __END_DECLS */
  
- #endif /* !_READPASSPHRASE_H_ */
+ #endif /* !LIBBSD_READPASSPHRASE_H */
 diff --git a/include/bsd/stdio.h b/include/bsd/stdio.h
-index 7697425..b5b3efd 100644
+index 4b69983..18645b7 100644
 --- a/include/bsd/stdio.h
 +++ b/include/bsd/stdio.h
-@@ -41,7 +41,10 @@
- #include <sys/cdefs.h>
+@@ -45,7 +45,10 @@
+ #endif
  #include <sys/types.h>
  
 -__BEGIN_DECLS
  const char *fmtcheck(const char *, const char *);
  
  /* XXX: The function requires cooperation from the system libc to store the
-@@ -69,7 +72,10 @@ FILE *funopen(const void *cookie,
+@@ -73,7 +76,10 @@ FILE *funopen(const void *cookie,
  #define fwopen(cookie, fn) funopen(cookie, NULL, fn, NULL, NULL)
  
  int fpurge(FILE *fp);
  #endif
  #endif
 diff --git a/include/bsd/stdlib.h b/include/bsd/stdlib.h
-index 0604cad..b9f0515 100644
+index ebc9638..c4b54b6 100644
 --- a/include/bsd/stdlib.h
 +++ b/include/bsd/stdlib.h
 @@ -46,7 +46,10 @@
 +#endif
  uint32_t arc4random(void);
  void arc4random_stir(void);
- void arc4random_addrandom(u_char *dat, int datlen);
-@@ -73,6 +76,9 @@ long long strtonum(const char *nptr, long long minval, long long maxval,
+ void arc4random_addrandom(unsigned char *dat, int datlen);
+@@ -67,7 +70,7 @@ int sradixsort(const unsigned char **base, int nmemb,
+                const unsigned char *table, unsigned endbyte);
+ 
+ void *reallocf(void *ptr, size_t size);
+-#if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 26)
++#if defined(_GNU_SOURCE) && defined(__GLIBC__)
+ void *reallocarray(void *ptr, size_t nmemb, size_t size);
+ #endif
+ 
+@@ -75,6 +78,9 @@ long long strtonum(const char *nptr, long long minval, long long maxval,
                     const char **errstr);
  
  char *getbsize(int *headerlenp, long *blocksizep);
  
  #endif
 diff --git a/include/bsd/string.h b/include/bsd/string.h
-index ee2f953..fbf8c54 100644
+index 6798bf6..fa1193f 100644
 --- a/include/bsd/string.h
 +++ b/include/bsd/string.h
-@@ -36,13 +36,19 @@
+@@ -36,15 +36,21 @@
  #include <sys/cdefs.h>
  #include <sys/types.h>
  
  char *strnstr(const char *str, const char *find, size_t str_len);
  void strmode(mode_t mode, char *str);
  
+-#if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 25)
++#if defined(_GNU_SOURCE) && defined(__GLIBC__)
  void explicit_bzero(void *buf, size_t len);
+ #endif
 -__END_DECLS
 +#ifdef __cplusplus
 +}
  
  #endif
 diff --git a/include/bsd/stringlist.h b/include/bsd/stringlist.h
-index e3c42e9..40d0a52 100644
+index ff30cac..4600f6b 100644
 --- a/include/bsd/stringlist.h
 +++ b/include/bsd/stringlist.h
 @@ -43,12 +43,18 @@ typedef struct _stringlist {
 +#endif
 +/* __END_DECLS */
  
- #endif /* _STRINGLIST_H */
+ #endif /* LIBBSD_STRINGLIST_H */
 diff --git a/include/bsd/unistd.h b/include/bsd/unistd.h
 index 1f9c5f8..5b2f4c7 100644
 --- a/include/bsd/unistd.h
  
  #endif
 diff --git a/include/bsd/vis.h b/include/bsd/vis.h
-index 835d2d6..63c951e 100644
+index 970dfdd..621d3c6 100644
 --- a/include/bsd/vis.h
 +++ b/include/bsd/vis.h
 @@ -74,7 +74,10 @@
 +#endif
 +/* __END_DECLS */
  
- #endif /* !_VIS_H_ */
+ #endif /* !LIBBSD_VIS_H */
 diff --git a/include/bsd/wchar.h b/include/bsd/wchar.h
 index 33a500e..aa70742 100644
 --- a/include/bsd/wchar.h
  
  #endif /* !_SHA512_H_ */
 -- 
-2.10.2
+1.9.1