gdb-safe-ctype.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* Wrapper around libiberty's safe-ctype.h for GDB, the GNU debugger.
  2. Copyright (C) 2019-2022 Free Software Foundation, Inc.
  3. This file is part of GDB.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  14. #ifndef GDB_SAFE_CTYPE_H
  15. #define GDB_SAFE_CTYPE_H
  16. /* After safe-ctype.h is included, we can no longer use the host's
  17. ctype routines. Trying to do so results in compile errors. Code
  18. that uses safe-ctype.h that wants to refer to the locale-dependent
  19. ctype functions must call these wrapper versions instead. */
  20. static inline int
  21. gdb_isprint (int ch)
  22. {
  23. return isprint (ch);
  24. }
  25. /* readline.h defines these symbols too, but we want libiberty's
  26. versions. */
  27. #undef ISALPHA
  28. #undef ISALNUM
  29. #undef ISDIGIT
  30. #undef ISLOWER
  31. #undef ISPRINT
  32. #undef ISUPPER
  33. #undef ISXDIGIT
  34. #include "safe-ctype.h"
  35. #endif