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_