assert.c 288 B

12345678910111213141516
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int _assert(char *e, char *file, int line) {
  4. fprintf(stderr, "assertion failed:");
  5. if (e)
  6. fprintf(stderr, " %s", e);
  7. if (file)
  8. fprintf(stderr, " file %s", file);
  9. fprintf(stderr, " line %d\n", line);
  10. fflush(stderr);
  11. abort();
  12. return 0;
  13. }