commit | 23c6cf792a59b98b0e5a295a19107459696f37fd | [log] [tgz] |
---|---|---|
author | Alex Clarke <[email protected]> | Wed Nov 21 13:22:27 2018 |
committer | Commit Bot <[email protected]> | Wed Nov 21 13:22:27 2018 |
tree | 4ce0fa5744f3e77a7ae8868052bba84107716c54 | |
parent | fa281606e29e42036396060eab7dfd0b18b0a831 [diff] [blame] |
Move PRETTY_FUNCTION macros to base/compiler_specific.h This will help https://crrev.com/c/1340317. [email protected] Bug: 906125, 907410 Change-Id: Id6d666a0e8dc18d8646a81dd16fadec16fe44abe Reviewed-on: https://chromium-review.googlesource.com/c/1344105 Commit-Queue: Alex Clarke <[email protected]> Reviewed-by: Alex Clarke <[email protected]> Reviewed-by: Sami Kyöstilä <[email protected]> Reviewed-by: Gabriel Charette <[email protected]> Cr-Commit-Position: refs/heads/master@{#610027}
diff --git a/base/compiler_specific.h b/base/compiler_specific.h index 924d1e4f..0d6bccc8 100644 --- a/base/compiler_specific.h +++ b/base/compiler_specific.h
@@ -217,4 +217,13 @@ #define FALLTHROUGH #endif +#if defined(COMPILER_GCC) +#define PRETTY_FUNCTION __PRETTY_FUNCTION__ +#elif defined(COMPILER_MSVC) +#define PRETTY_FUNCTION __FUNCSIG__ +#else +// See https://en.cppreference.com/w/c/language/function_definition#func +#define PRETTY_FUNCTION __func__ +#endif + #endif // BASE_COMPILER_SPECIFIC_H_