assert.h 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. #include <assert/assert.h>
  2. #ifndef _ISOMAC
  3. /* This prints an "Assertion failed" message and aborts.
  4. In installed assert.h this is only conditionally declared,
  5. so it has to be repeated here. */
  6. extern void __assert_fail (const char *__assertion, const char *__file,
  7. unsigned int __line, const char *__function)
  8. __THROW __attribute__ ((__noreturn__));
  9. /* Likewise, but prints the error text for ERRNUM. */
  10. extern void __assert_perror_fail (int __errnum, const char *__file,
  11. unsigned int __line,
  12. const char *__function)
  13. __THROW __attribute__ ((__noreturn__));
  14. /* The real implementation of the two functions above. */
  15. extern void __assert_fail_base (const char *fmt, const char *assertion,
  16. const char *file, unsigned int line,
  17. const char *function)
  18. __THROW __attribute__ ((__noreturn__)) attribute_hidden;
  19. rtld_hidden_proto (__assert_fail)
  20. rtld_hidden_proto (__assert_perror_fail)
  21. libc_hidden_proto (__assert_perror_fail)
  22. # if IS_IN (libc)
  23. /* Redirect to the internal version which does not use stderr. */
  24. extern _Noreturn __typeof (__assert_fail) __libc_assert_fail attribute_hidden;
  25. # define __assert_fail __libc_assert_fail
  26. # endif
  27. #endif