libproc-ng: support building without WCHAR support
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>
This commit is contained in:
parent
dd03003edd
commit
86fe50d179
@ -15,7 +15,7 @@
|
|||||||
#include "escape.h"
|
#include "escape.h"
|
||||||
#include "readproc.h"
|
#include "readproc.h"
|
||||||
|
|
||||||
#if (__GNU_LIBRARY__ >= 6)
|
#if (__GNU_LIBRARY__ >= 6) && (!defined(__UCLIBC__) || defined(__UCLIBC_HAS_WCHAR__))
|
||||||
# include <wchar.h>
|
# include <wchar.h>
|
||||||
# include <wctype.h>
|
# include <wctype.h>
|
||||||
# include <stdlib.h> /* MB_CUR_MAX */
|
# include <stdlib.h> /* MB_CUR_MAX */
|
||||||
@ -23,7 +23,7 @@
|
|||||||
# include <langinfo.h>
|
# include <langinfo.h>
|
||||||
#endif
|
#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){
|
static int escape_str_utf8(char *restrict dst, const char *restrict src, int bufsize, int *maxcells){
|
||||||
int my_cells = 0;
|
int my_cells = 0;
|
||||||
int my_bytes = 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;
|
static int utf_init=0;
|
||||||
|
|
||||||
if(utf_init==0){
|
if(utf_init==0){
|
||||||
|
Loading…
Reference in New Issue
Block a user