Ticket #2234: glib2-wcslen-darwin6.patch
File glib2-wcslen-darwin6.patch, 1.2 KB (added by namely_void@…, 20 years ago) |
---|
-
glib/gnulib/vasnprintf.c
old new 41 41 #include <float.h> /* DBL_MAX_EXP, LDBL_MAX_EXP */ 42 42 #include "printf-parse.h" 43 43 44 #ifdef HAVE_WCHAR_T 45 # ifdef HAVE_WCSLEN 46 # define local_wcslen wcslen 47 # else 48 /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid 49 a dependency towards this library, here is a local substitute. 50 Define this substitute only once, even if this file is included 51 twice in the same compilation unit. */ 52 # ifndef local_wcslen_defined 53 # define local_wcslen_defined 1 54 static size_t 55 local_wcslen (const wchar_t *s) 56 { 57 const wchar_t *ptr; 58 59 for (ptr = s; *ptr != (wchar_t) 0; ptr++) 60 ; 61 return ptr - s; 62 } 63 # endif 64 # endif 65 #endif 66 44 67 /* For those losing systems which don't have 'alloca' we have to add 45 68 some additional code emulating it. */ 46 69 #ifdef HAVE_ALLOCA … … 539 562 # ifdef HAVE_WCHAR_T 540 563 if (type == TYPE_WIDE_STRING) 541 564 tmp_length = 542 wcslen (a.arg[dp->arg_index].a.a_wide_string)565 local_wcslen (a.arg[dp->arg_index].a.a_wide_string) 543 566 * MB_CUR_MAX; 544 567 else 545 568 # endif