complaints.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* Definitions for complaint handling during symbol reading in GDB.
  2. Copyright (C) 1990-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. #if !defined (COMPLAINTS_H)
  15. #define COMPLAINTS_H
  16. /* Helper for complaint. */
  17. extern void complaint_internal (const char *fmt, ...)
  18. ATTRIBUTE_PRINTF (1, 2);
  19. /* This controls whether complaints are emitted. */
  20. extern int stop_whining;
  21. /* Register a complaint. This is a macro around complaint_internal to
  22. avoid computing complaint's arguments when complaints are disabled.
  23. Running FMT via gettext [i.e., _(FMT)] can be quite expensive, for
  24. example. */
  25. #define complaint(FMT, ...) \
  26. do \
  27. { \
  28. if (stop_whining > 0) \
  29. complaint_internal (FMT, ##__VA_ARGS__); \
  30. } \
  31. while (0)
  32. /* Clear out / initialize all complaint counters that have ever been
  33. incremented. */
  34. extern void clear_complaints ();
  35. #endif /* !defined (COMPLAINTS_H) */