Skip to content

Commit

Permalink
COMMON: Forbid symbols for the rest of is* from ctype.h.
Browse files Browse the repository at this point in the history
I also moved the isprint case to the correct position.

This adds a FIXME to our lua code from sword25, which uses iscntrl directly.
  • Loading branch information
Johannes Schickel committed Dec 13, 2012
1 parent b0ba4b0 commit 2773f5d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
26 changes: 23 additions & 3 deletions common/forbidden.h
Expand Up @@ -333,11 +333,21 @@
#define isalpha(a) FORBIDDEN_SYMBOL_REPLACEMENT
#endif

#ifndef FORBIDDEN_SYMBOL_EXCEPTION_iscntrl
#undef iscntrl
#define iscntrl(a) FORBIDDEN_SYMBOL_REPLACEMENT
#endif

#ifndef FORBIDDEN_SYMBOL_EXCEPTION_isdigit
#undef isdigit
#define isdigit(a) FORBIDDEN_SYMBOL_REPLACEMENT
#endif

#ifndef FORBIDDEN_SYMBOL_EXCEPTION_isgraph
#undef isgraph
#define isgraph(a) FORBIDDEN_SYMBOL_REPLACEMENT
#endif

#ifndef FORBIDDEN_SYMBOL_EXCEPTION_isnumber
#undef isnumber
#define isnumber(a) FORBIDDEN_SYMBOL_REPLACEMENT
Expand All @@ -348,6 +358,16 @@
#define islower(a) FORBIDDEN_SYMBOL_REPLACEMENT
#endif

#ifndef FORBIDDEN_SYMBOL_EXCEPTION_isprint
#undef isprint
#define isprint(a) FORBIDDEN_SYMBOL_REPLACEMENT
#endif

#ifndef FORBIDDEN_SYMBOL_EXCEPTION_ispunct
#undef ispunct
#define ispunct(a) FORBIDDEN_SYMBOL_REPLACEMENT
#endif

#ifndef FORBIDDEN_SYMBOL_EXCEPTION_isspace
#undef isspace
#define isspace(a) FORBIDDEN_SYMBOL_REPLACEMENT
Expand All @@ -358,9 +378,9 @@
#define isupper(a) FORBIDDEN_SYMBOL_REPLACEMENT
#endif

#ifndef FORBIDDEN_SYMBOL_EXCEPTION_isprint
#undef isprint
#define isprint(a) FORBIDDEN_SYMBOL_REPLACEMENT
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_isxdigit
#undef isxdigit
#define isxdigit(a) FORBIDDEN_SYMBOL_REPLACEMENT
#endif

#endif // FORBIDDEN_SYMBOL_EXCEPTION_ctype_h
Expand Down
2 changes: 2 additions & 0 deletions engines/sword25/util/lua/llex.cpp
Expand Up @@ -4,6 +4,8 @@
** See Copyright Notice in lua.h
*/

// FIXME: Do not directly use iscntrl from ctype.h.
#define FORBIDDEN_SYMBOL_EXCEPTION_iscntrl

#include "common/util.h"

Expand Down

0 comments on commit 2773f5d

Please sign in to comment.