Skip to content

Commit

Permalink
Remove _lib_iswprint preprocessor sym
Browse files Browse the repository at this point in the history
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 fec4777
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 18 deletions.
1 change: 0 additions & 1 deletion config_ast.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions features/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
3 changes: 0 additions & 3 deletions src/cmd/ksh93/edit/vi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
9 changes: 0 additions & 9 deletions src/cmd/ksh93/sh/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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) == '_')

//
Expand Down

0 comments on commit fec4777

Please sign in to comment.