diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-06-22 11:51:58 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-06-22 11:51:58 -0400 |
commit | 6fc2d532274ead9c903c6d94b1a513b8d9b6f677 (patch) | |
tree | 1322e7fe3f1dca69e41127bb2a46d6dca54479d0 /src/common/util_bug.h | |
parent | 7a93ce8f6382a2fe8687e7e42dc398e08480c901 (diff) | |
download | tor-6fc2d532274ead9c903c6d94b1a513b8d9b6f677.tar.gz tor-6fc2d532274ead9c903c6d94b1a513b8d9b6f677.zip |
Remove util_bug dependency on compat.h
Diffstat (limited to 'src/common/util_bug.h')
-rw-r--r-- | src/common/util_bug.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/common/util_bug.h b/src/common/util_bug.h index fb5ab25c17..a0753c807b 100644 --- a/src/common/util_bug.h +++ b/src/common/util_bug.h @@ -37,8 +37,8 @@ #define TOR_UTIL_BUG_H #include "orconfig.h" -#include <stdlib.h> -#include "common/compat.h" +#include "lib/cc/compat_compiler.h" +#include "lib/log/torlog.h" #include "lib/testsupport/testsupport.h" /* Replace assert() with a variant that sends failures to the log before @@ -192,6 +192,14 @@ void tor_bug_occurred_(const char *fname, unsigned int line, const char *func, const char *expr, int once); +#ifdef _WIN32 +#define SHORT_FILE__ (tor_fix_source_file(__FILE__)) +const char *tor_fix_source_file(const char *fname); +#else +#define SHORT_FILE__ (__FILE__) +#define tor_fix_source_file(s) (s) +#endif /* defined(_WIN32) */ + #ifdef TOR_UNIT_TESTS void tor_capture_bugs_(int n); void tor_end_capture_bugs_(void); |