Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2215)

Unified Diff: base/compiler_specific.h

Issue 2518253002: Move Partition Allocator into Chromium base. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/compiler_specific.h
diff --git a/base/compiler_specific.h b/base/compiler_specific.h
index 0f4c058b3be43963d76c23b0b3b8ec89fc8b3767..278ef924f91ee36a70bf4042ecfd3aebd930ef72 100644
--- a/base/compiler_specific.h
+++ b/base/compiler_specific.h
@@ -230,4 +230,18 @@
#define HAS_FEATURE(FEATURE) 0
#endif
+#if defined(COMPILER_GCC)
+#define PRETTY_FUNCTION __PRETTY_FUNCTION__
+#elif defined(COMPILER_MSVC)
+#define PRETTY_FUNCTION __FUNCSIG__
+#else
+#define PRETTY_FUNCTION __func__
+#endif
+
+// Returns a string that contains the type name of |T| as a substring.
+template <typename T>
+inline const char* GetStringWithTypeName() {
+ return PRETTY_FUNCTION;
+}
+
#endif // BASE_COMPILER_SPECIFIC_H_

Powered by Google App Engine
This is Rietveld 408576698