summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/my_global.h19
-rw-r--r--sql/sql_profile.cc3
-rw-r--r--sql/sql_profile.h8
3 files changed, 19 insertions, 11 deletions
diff --git a/include/my_global.h b/include/my_global.h
index 815be622b16..0f2aea62438 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -1574,6 +1574,25 @@ inline void operator delete[](void*, void*) { /* Do nothing */ }
#define bool In_C_you_should_use_my_bool_instead()
#endif
+/* Provide __func__ macro definition for platforms that miss it. */
+#if __STDC_VERSION__ < 199901L
+# if __GNUC__ >= 2
+# define __func__ __FUNCTION__
+# else
+# define __func__ "<unknown>"
+# endif
+#elif defined(_MSC_VER)
+# if _MSC_VER < 1300
+# define __func__ "<unknown>"
+# else
+# define __func__ __FUNCTION__
+# endif
+#elif defined(__BORLANDC__)
+# define __func__ __FUNC__
+#else
+# define __func__ "<unknown>"
+#endif
+
#ifndef HAVE_RINT
/**
All integers up to this number can be represented exactly as double precision
diff --git a/sql/sql_profile.cc b/sql/sql_profile.cc
index 69e5bc3cbb4..0f67c865d45 100644
--- a/sql/sql_profile.cc
+++ b/sql/sql_profile.cc
@@ -38,9 +38,6 @@
#define MAX_QUERY_LENGTH 300
-/* Reserved for systems that can't record the function name in source. */
-const char * const _unknown_func_ = "<unknown>";
-
/**
Connects Information_Schema and Profiling.
*/
diff --git a/sql/sql_profile.h b/sql/sql_profile.h
index bffe1cb576b..e9c5686efab 100644
--- a/sql/sql_profile.h
+++ b/sql/sql_profile.h
@@ -16,14 +16,6 @@
#ifndef _SQL_PROFILE_H
#define _SQL_PROFILE_H
-#ifndef __func__
-#ifdef __FUNCTION__
-#define __func__ __FUNCTION__
-#else
-#define __func__ "unknown function"
-#endif
-#endif
-
extern ST_FIELD_INFO query_profile_statistics_info[];
int fill_query_profile_statistics_info(THD *thd, TABLE_LIST *tables, Item *cond);
int make_profile_table_for_show(THD *thd, ST_SCHEMA_TABLE *schema_table);