]> granicus.if.org Git - procps-ng/commitdiff
libproc-ng: support building without WCHAR support
authorHamish Moffatt <hamish@cloud.net.au>
Tue, 9 Sep 2008 02:06:52 +0000 (02:06 +0000)
committerCraig Small <csmall@enc.com.au>
Sat, 17 Dec 2011 23:36:07 +0000 (10:36 +1100)
The uClibc might not have wchar.

A patch from Buildroot.

Reference: http://git.buildroot.net/buildroot/tree/package/procps/procps-wchar.patch?id=fc333e7d083d144e0f8d1c4bac061b8de2ee7510
Backported-by: Sami Kerola <kerolasa@iki.fi>
proc/escape.c

index 92ba4b195e8ca13952b4db846e49e51a5191aebb..1fd4e74af2c7ecefaf2054a1d42a9c3ec91d58bf 100644 (file)
@@ -15,7 +15,7 @@
 #include "escape.h"
 #include "readproc.h"
 
-#if (__GNU_LIBRARY__ >= 6)
+#if (__GNU_LIBRARY__ >= 6) && (!defined(__UCLIBC__) || defined(__UCLIBC_HAS_WCHAR__))
 # include <wchar.h>
 # include <wctype.h>
 # include <stdlib.h>  /* MB_CUR_MAX */
@@ -23,7 +23,7 @@
 # include <langinfo.h>
 #endif
 
-#if (__GNU_LIBRARY__ >= 6)
+#if (__GNU_LIBRARY__ >= 6) && (!defined(__UCLIBC__) || defined(__UCLIBC_HAS_WCHAR__))
 static int escape_str_utf8(char *restrict dst, const char *restrict src, int bufsize, int *maxcells){
   int my_cells = 0;
   int my_bytes = 0;
@@ -116,7 +116,7 @@ int escape_str(char *restrict dst, const char *restrict src, int bufsize, int *m
   "????????????????????????????????"
   "????????????????????????????????";
   
-#if (__GNU_LIBRARY__ >= 6)
+#if (__GNU_LIBRARY__ >= 6) && (!defined(__UCLIBC__) || defined(__UCLIBC_HAS_WCHAR__))
   static int utf_init=0;
   
   if(utf_init==0){