2 * Eddie Kohler, Yandong Mao, Robert Morris
3 * Copyright (c) 2012-2014 President and Fellows of Harvard College
4 * Copyright (c) 2012-2014 Massachusetts Institute of Technology
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, subject to the conditions
9 * listed in the Masstree LICENSE file. These conditions include: you must
10 * preserve this copyright notice, and you cannot mention the copyright
11 * holders in advertising related to the Software without their permission.
12 * The Software is provided WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED. This
13 * notice is a summary of the Masstree LICENSE file; the license in that file
16 #include "compiler.hh"
20 void fail_always_assert(const char* file, int line,
21 const char* assertion, const char* message) {
23 fprintf(stderr, "assertion \"%s\" [%s] failed: file \"%s\", line %d\n",
24 message, assertion, file, line);
26 fprintf(stderr, "assertion \"%s\" failed: file \"%s\", line %d\n",
27 assertion, file, line);
31 void fail_masstree_invariant(const char* file, int line,
32 const char* assertion, const char* message) {
34 fprintf(stderr, "invariant \"%s\" [%s] failed: file \"%s\", line %d\n",
35 message, assertion, file, line);
37 fprintf(stderr, "invariant \"%s\" failed: file \"%s\", line %d\n",
38 assertion, file, line);
42 void fail_masstree_precondition(const char* file, int line,
43 const char* assertion, const char* message) {
45 fprintf(stderr, "precondition \"%s\" [%s] failed: file \"%s\", line %d\n",
46 message, assertion, file, line);
48 fprintf(stderr, "precondition \"%s\" failed: file \"%s\", line %d\n",
49 assertion, file, line);