Skip to content
Permalink
Browse files

Remove _lib_iswprint preprocessor sym

Every platform we currently support provides iswprint(). Furthermore, the
adhoc fallbacks are incorrect; albeit, in practice probably good enough.
  • Loading branch information...
krader1961 committed Jul 23, 2019
1 parent 812d612 commit fec4777153dc987b9af869cb379833040fa316ed
Showing with 0 additions and 18 deletions.
  1. +0 −1 config_ast.h.in
  2. +0 −5 features/meson.build
  3. +0 −3 src/cmd/ksh93/edit/vi.c
  4. +0 −9 src/cmd/ksh93/sh/string.c
@@ -110,7 +110,6 @@
#mesondefine _lib_getexecname
#mesondefine _lib_getrusage
#mesondefine _lib_gettimeofday
#mesondefine _lib_iswprint
#mesondefine _lib_lchmod
#mesondefine _lib_lchmod_fchmodat_fallback
#mesondefine _lib_loadbind
@@ -93,11 +93,6 @@ feature_data.set10('_lib_getrusage',
args: feature_test_args))
feature_data.set10('_lib_sigqueue',
cc.has_function('sigqueue', prefix: '#include <signal.h>', args: feature_test_args))
# TODO: Enable iswprint() detection when we understand why doing so causes the
# `wchar` unit test to fail. For now we force it to false to use the AST definition.
# feature_data.set10('_lib_iswprint',
# cc.has_function('iswprint', prefix: '#include <wctype.h>', args: feature_test_args))
feature_data.set10('_lib_iswprint', 0)

if not cc.has_function('isnanl', prefix: '#include <math.h>', args: feature_test_args)
feature_data.set('isnanl', 'isnan')
@@ -51,9 +51,6 @@
#define genlen(str) ed_genlen(str)
#define digit(c) ((c & ~STRIP) == 0 && isdigit(c))
#define is_print(c) ((c & ~STRIP) || isprint(c))
#if !_lib_iswprint && !defined(iswprint)
#define iswprint(c) ((c & ~0177) || isprint(c))
#endif // !_lib_iswprint && !defined(iswprint)
static_fn int _vi_isalph(int);
static_fn int _vi_isblank(int);
#define vi_isblank(v) _vi_isblank(virtual[v])
@@ -28,10 +28,7 @@
#include <stdlib.h>
#include <string.h>
#include <wchar.h>

#if _lib_iswprint
#include <wctype.h>
#endif

#include "ast.h"
#include "ast_assert.h"
@@ -42,12 +39,6 @@
#include "shtable.h"
#include "stk.h"

#if !_lib_iswprint
// On some platforms iswprint() may be macro so make sure we don't get a redefinition warning.
#undef iswprint
#define iswprint(c) (((c) & ~0377) || isprint(c))
#endif

#define sep(c) ((c) == '-' || (c) == '_')

//

0 comments on commit fec4777

Please sign in to comment.
You can’t perform that action at this time.