#At file:///home/dlenev/src/bzr/mysql-6.0-3726-w2/
2673 Dmitry Lenev 2008-06-25
Fix build failure of mysql-6.0-3726 tree on Windows.
The failure was caused by the fact that sql/mdl.cc was
using __func__ macro without including sql_profile.h
header which contained definition of this macro for
those platforms that miss it.
This patch solves this problem by moving this define to
include/my_global.h which makes it available in modules
which don't/can't include sql/mysql_priv.h.
modified:
include/my_global.h
sql/sql_profile.cc
sql/sql_profile.h
per-file messages:
include/my_global.h
Moved definition of __func__ macro from sql/sql_profile.h to include/my_global.h to make it accessible from those modules of
the server which don't include mysql_priv.h.
sql/sql_profile.cc
Removed _unknown_func_ const variable since it is no
longer used by __func__ macro.
sql/sql_profile.h
Moved definition of __func__ macro from sql/sql_profile.h to include/my_global.h to make it accessible from those modules of
the server which don't include mysql_priv.h.
=== modified file 'include/my_global.h'
--- a/include/my_global.h 2008-05-21 10:17:29 +0000
+++ b/include/my_global.h 2008-06-25 16:14:37 +0000
@@ -1513,4 +1513,23 @@ inline void operator delete[](void*, vo
#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
+
#endif /* my_global_h */
=== modified file 'sql/sql_profile.cc'
--- a/sql/sql_profile.cc 2008-02-19 21:33:56 +0000
+++ b/sql/sql_profile.cc 2008-06-25 16:14:37 +0000
@@ -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.
*/
=== modified file 'sql/sql_profile.h'
--- a/sql/sql_profile.h 2007-12-20 16:29:11 +0000
+++ b/sql/sql_profile.h 2008-06-25 16:14:37 +0000
@@ -16,27 +16,6 @@
#ifndef _SQL_PROFILE_H
#define _SQL_PROFILE_H
-#if __STDC_VERSION__ < 199901L
-# if __GNUC__ >= 2
-# define __func__ __FUNCTION__
-# else
-# define __func__ _unknown_func_
-extern const char * const _unknown_func_;
-# endif
-#elif defined(_MSC_VER)
-# if _MSC_VER < 1300
-# define __func__ _unknown_func_
-extern const char * const _unknown_func_;
-# else
-# define __func__ __FUNCTION__
-# endif
-#elif defined(__BORLANDC__)
-# define __func__ __FUNC__
-#else
-# define __func__ _unknown_func_
-extern const char * const _unknown_func_;
-#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);