changeset 13679:f4c397f20139

unistr/base: Avoid link errors when module 'libunistring' is also used. * lib/unistr.in.h (u8_mbtouc_unsafe, u16_mbtouc_unsafe, u32_mbtouc_unsafe, u8_mbtouc, u16_mbtouc, u32_mbtouc, u8_mbtoucr, u16_mbtoucr, u32_mbtoucr, u8_uctomb_aux, u16_uctomb_aux, u32_uctomb): Declare also when HAVE_LIBUNISTRING is set. Reported by Pádraig Brady <P@draigbrady.com>.
author Bruno Haible <bruno@clisp.org>
date Wed, 15 Sep 2010 02:43:33 +0200
parents 794abd047acd
children 1213dbc889d0
files ChangeLog lib/unistr.in.h
diffstat 2 files changed, 21 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-09-14  Bruno Haible  <bruno@clisp.org>
+
+	unistr/base: Avoid link errors when module 'libunistring' is also used.
+	* lib/unistr.in.h (u8_mbtouc_unsafe, u16_mbtouc_unsafe,
+	u32_mbtouc_unsafe, u8_mbtouc, u16_mbtouc, u32_mbtouc, u8_mbtoucr,
+	u16_mbtoucr, u32_mbtoucr, u8_uctomb_aux, u16_uctomb_aux, u32_uctomb):
+	Declare also when HAVE_LIBUNISTRING is set.
+	Reported by Pádraig Brady <P@draigbrady.com>.
+
 2010-09-14  Eric Blake  <eblake@redhat.com>
 
 	test-rawmemchr: make more robust
--- a/lib/unistr.in.h
+++ b/lib/unistr.in.h
@@ -134,7 +134,7 @@
 /* The variants with _safe suffix are safe, even if the library is compiled
    without --enable-safety.  */
 
-#ifdef GNULIB_UNISTR_U8_MBTOUC_UNSAFE
+#if GNULIB_UNISTR_U8_MBTOUC_UNSAFE || HAVE_LIBUNISTRING
 # if !HAVE_INLINE
 extern int
        u8_mbtouc_unsafe (ucs4_t *puc, const uint8_t *s, size_t n);
@@ -157,7 +157,7 @@
 # endif
 #endif
 
-#ifdef GNULIB_UNISTR_U16_MBTOUC_UNSAFE
+#if GNULIB_UNISTR_U16_MBTOUC_UNSAFE || HAVE_LIBUNISTRING
 # if !HAVE_INLINE
 extern int
        u16_mbtouc_unsafe (ucs4_t *puc, const uint16_t *s, size_t n);
@@ -180,7 +180,7 @@
 # endif
 #endif
 
-#ifdef GNULIB_UNISTR_U32_MBTOUC_UNSAFE
+#if GNULIB_UNISTR_U32_MBTOUC_UNSAFE || HAVE_LIBUNISTRING
 # if !HAVE_INLINE
 extern int
        u32_mbtouc_unsafe (ucs4_t *puc, const uint32_t *s, size_t n);
@@ -205,7 +205,7 @@
 # endif
 #endif
 
-#ifdef GNULIB_UNISTR_U8_MBTOUC
+#if GNULIB_UNISTR_U8_MBTOUC || HAVE_LIBUNISTRING
 # if !HAVE_INLINE
 extern int
        u8_mbtouc (ucs4_t *puc, const uint8_t *s, size_t n);
@@ -228,7 +228,7 @@
 # endif
 #endif
 
-#ifdef GNULIB_UNISTR_U16_MBTOUC
+#if GNULIB_UNISTR_U16_MBTOUC || HAVE_LIBUNISTRING
 # if !HAVE_INLINE
 extern int
        u16_mbtouc (ucs4_t *puc, const uint16_t *s, size_t n);
@@ -251,7 +251,7 @@
 # endif
 #endif
 
-#ifdef GNULIB_UNISTR_U32_MBTOUC
+#if GNULIB_UNISTR_U32_MBTOUC || HAVE_LIBUNISTRING
 # if !HAVE_INLINE
 extern int
        u32_mbtouc (ucs4_t *puc, const uint32_t *s, size_t n);
@@ -279,17 +279,17 @@
 /* Similar to u*_mbtouc(), except that the return value gives more details
    about the failure, similar to mbrtowc().  */
 
-#ifdef GNULIB_UNISTR_U8_MBTOUCR
+#if GNULIB_UNISTR_U8_MBTOUCR || HAVE_LIBUNISTRING
 extern int
        u8_mbtoucr (ucs4_t *puc, const uint8_t *s, size_t n);
 #endif
 
-#ifdef GNULIB_UNISTR_U16_MBTOUCR
+#if GNULIB_UNISTR_U16_MBTOUCR || HAVE_LIBUNISTRING
 extern int
        u16_mbtoucr (ucs4_t *puc, const uint16_t *s, size_t n);
 #endif
 
-#ifdef GNULIB_UNISTR_U32_MBTOUCR
+#if GNULIB_UNISTR_U32_MBTOUCR || HAVE_LIBUNISTRING
 extern int
        u32_mbtoucr (ucs4_t *puc, const uint32_t *s, size_t n);
 #endif
@@ -300,7 +300,7 @@
 /* Similar to wctomb(), except that s must not be NULL, and the argument n
    must be specified.  */
 
-#ifdef GNULIB_UNISTR_U8_UCTOMB
+#if GNULIB_UNISTR_U8_UCTOMB || HAVE_LIBUNISTRING
 /* Auxiliary function, also used by u8_chr, u8_strchr, u8_strrchr.  */
 extern int
        u8_uctomb_aux (uint8_t *s, ucs4_t uc, int n);
@@ -322,7 +322,7 @@
 # endif
 #endif
 
-#ifdef GNULIB_UNISTR_U16_UCTOMB
+#if GNULIB_UNISTR_U16_UCTOMB || HAVE_LIBUNISTRING
 /* Auxiliary function, also used by u16_chr, u16_strchr, u16_strrchr.  */
 extern int
        u16_uctomb_aux (uint16_t *s, ucs4_t uc, int n);
@@ -344,7 +344,7 @@
 # endif
 #endif
 
-#ifdef GNULIB_UNISTR_U32_UCTOMB
+#if GNULIB_UNISTR_U32_UCTOMB || HAVE_LIBUNISTRING
 # if !HAVE_INLINE
 extern int
        u32_uctomb (uint32_t *s, ucs4_t uc, int n);