about summary refs log tree commit diff
path: root/wcsmbs/btowc.c
diff options
context:
space:
mode:
Diffstat (limited to 'wcsmbs/btowc.c')
-rw-r--r--wcsmbs/btowc.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/wcsmbs/btowc.c b/wcsmbs/btowc.c
index 6add7ed8bb..6517d4f635 100644
--- a/wcsmbs/btowc.c
+++ b/wcsmbs/btowc.c
@@ -26,6 +26,8 @@
 #include <wcsmbsload.h>
 #include <limits.h>
 
+#include <sysdep.h>
+
 
 wint_t
 __btowc (c)
@@ -45,13 +47,17 @@ __btowc (c)
 
   /* Get the conversion functions.  */
   fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE));
+  __gconv_btowc_fct btowc_fct = fcts->towc->__btowc_fct;
 
   if (__builtin_expect (fcts->towc_nsteps == 1, 1)
-      && __builtin_expect (fcts->towc->__btowc_fct != NULL, 1))
+      && __builtin_expect (btowc_fct != NULL, 1))
     {
       /* Use the shortcut function.  */
-      return DL_CALL_FCT (fcts->towc->__btowc_fct,
-			  (fcts->towc, (unsigned char) c));
+#ifdef PTR_DEMANGLE
+      if (fcts->towc->__shlib_handle != NULL)
+	PTR_DEMANGLE (btowc_fct);
+#endif
+      return DL_CALL_FCT (btowc_fct, (fcts->towc, (unsigned char) c));
     }
   else
     {
@@ -78,9 +84,13 @@ __btowc (c)
       /* Create the input string.  */
       inbuf[0] = c;
 
-      status = DL_CALL_FCT (fcts->towc->__fct,
-			    (fcts->towc, &data, &inptr, inptr + 1,
-			     NULL, &dummy, 0, 1));
+      __gconv_fct fct = fcts->towc->__fct;
+#ifdef PTR_DEMANGLE
+      if (fcts->towc->__shlib_handle != NULL)
+	PTR_DEMANGLE (fct);
+#endif
+      status = DL_CALL_FCT (fct, (fcts->towc, &data, &inptr, inptr + 1,
+				  NULL, &dummy, 0, 1));
 
       if (status != __GCONV_OK && status != __GCONV_FULL_OUTPUT
 	  && status != __GCONV_EMPTY_INPUT)