PageRenderTime 42ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/contrib/cvs/src/error.h

https://bitbucket.org/freebsd/freebsd-head/
C++ Header | 62 lines | 32 code | 7 blank | 23 comment | 9 complexity | e308299785b505d4ea4ac73fa0b09bbc MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, BSD-3-Clause, LGPL-2.0, LGPL-2.1, BSD-2-Clause, 0BSD, JSON, AGPL-1.0, GPL-2.0
  1. /* error.h -- declaration for error-reporting function
  2. Copyright (C) 1995 Software Foundation, Inc.
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 2, or (at your option)
  6. any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details. */
  11. #ifndef ERROR_H
  12. #define ERROR_H
  13. /* Add prototype support. Normally this is done in cvs.h, but that
  14. doesn't get included from lib/savecwd.c. */
  15. #ifndef PROTO
  16. #if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
  17. #define PROTO(ARGS) ARGS
  18. #else
  19. #define PROTO(ARGS) ()
  20. #endif
  21. #endif
  22. #ifndef __attribute__
  23. /* This feature is available in gcc versions 2.5 and later. */
  24. # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
  25. # define __attribute__(Spec) /* empty */
  26. # endif
  27. /* The __-protected variants of `format' and `printf' attributes
  28. are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
  29. # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
  30. # define __format__ format
  31. # define __printf__ printf
  32. # define __noreturn__ noreturn
  33. # endif
  34. #endif
  35. #ifdef __STDC__
  36. void error (int, int, const char *, ...) \
  37. __attribute__ ((__format__ (__printf__, 3, 4)));
  38. #else
  39. void error ();
  40. #endif
  41. /* Exit due to an error. Similar to error (1, 0, "message"), but call
  42. it in the case where the message has already been printed. */
  43. #ifdef __STDC__
  44. void error_exit (void) __attribute__ ((__noreturn__));
  45. #else
  46. void error_exit ();
  47. #endif
  48. /* If non-zero, error will use the CVS protocol to report error
  49. messages. This will only be set in the CVS server parent process;
  50. most other code is run via do_cvs_command, which forks off a child
  51. process and packages up its stderr in the protocol. */
  52. extern int error_use_protocol;
  53. #endif /* ERROR_H */