~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to config/link-warning.h

  • Committer: Mats Kindahl
  • Date: 2008-08-26 07:32:59 UTC
  • mto: (489.1.2 codestyle)
  • mto: This revision was merged to the branch mainline in revision 491.
  • Revision ID: mats@mysql.com-20080826073259-9k4evtajgldgolli
Replaced use of thd_proc_info() macro with calls to
set_proc_info() and get_proc_info() internally.  Introduced
functions set_thd_proc_info() and get_thd_proc_info() for
external users, i.e., plug-ins.

The set_thd_proc_info() accepted callers info that can be used to
print debug output, but the information was not used. The return
value was changed to void and the old value is not fetched any
more. To be able to get the value of proc_info for external
users, the function get_thd_proc_info() was introduced.

The thd_proc_info() macro called set_thd_proc_info() but almost
never used the return value of set_thd_proc_info() so the macro
was replaced with a call of THD::set_proc_info().

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2007, 2009  Free Software Foundation, Inc.
3
 
 *
4
 
 * This library is free software; you can redistribute it and/or
5
 
 * modify it under the terms of the GNU Lesser General Public
6
 
 * License as published by the Free Software Foundation; either
7
 
 * version 2.1 of the License, or (at your option) any later version.
8
 
 *
9
 
 * This library is distributed in the hope that it will be useful,
10
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 
 * Lesser General Public License for more details.
13
 
 *
14
 
 * You should have received a copy of the GNU Lesser General Public
15
 
 * License along with this library; if not, write to the Free Software
16
 
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17
 
 * 02110-1301 USA
18
 
 *
19
 
 */
20
 
 
21
 
/* GL_LINK_WARNING("literal string") arranges to emit the literal string as
22
 
   a linker warning on most glibc systems.
23
 
   We use a linker warning rather than a preprocessor warning, because
24
 
   #warning cannot be used inside macros.  */
25
 
 
26
 
#ifndef GL_LINK_WARNING
27
 
  /* This works on platforms with GNU ld and ELF object format.
28
 
     Testing __GLIBC__ is sufficient for asserting that GNU ld is in use.
29
 
     Testing __ELF__ guarantees the ELF object format.
30
 
     Testing __GNUC__ is necessary for the compound expression syntax.  */
31
 
# if defined __GLIBC__ && defined __ELF__ && defined __GNUC__
32
 
#  define GL_LINK_WARNING(message) \
33
 
     GL_LINK_WARNING1 (__FILE__, __LINE__, message)
34
 
#  define GL_LINK_WARNING1(file, line, message) \
35
 
     GL_LINK_WARNING2 (file, line, message)  /* macroexpand file and line */
36
 
#  define GL_LINK_WARNING2(file, line, message) \
37
 
     GL_LINK_WARNING3 (file ":" #line ": warning: " message)
38
 
#  define GL_LINK_WARNING3(message) \
39
 
     ({ static const char warning[sizeof (message)]             \
40
 
          __attribute__ ((__unused__,                           \
41
 
                          __section__ (".gnu.warning"),         \
42
 
                          __aligned__ (1)))                     \
43
 
          = message "\n";                                       \
44
 
        (void)0;                                                \
45
 
     })
46
 
# else
47
 
#  define GL_LINK_WARNING(message) ((void) 0)
48
 
# endif
49
 
#endif