~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/univ.i

  • Committer: Monty Taylor
  • Date: 2009-12-21 08:16:13 UTC
  • mto: (1253.2.3 out-of-tree)
  • mto: This revision was merged to the branch mainline in revision 1250.
  • Revision ID: mordred@inaugust.com-20091221081613-xhpsndup5jrwihtw
Removed global_charset_info.h from server_includes.h

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
Copyright (c) 1994, 2009, Innobase Oy. All Rights Reserved.
4
4
Copyright (c) 2008, Google Inc.
 
5
Copyright (c) 2009, Sun Microsystems, Inc.
5
6
 
6
7
Portions of this file contain modifications contributed and copyrighted by
7
8
Google, Inc. Those modifications are gratefully acknowledged and are described
9
10
incorporated with their permission, and subject to the conditions contained in
10
11
the file COPYING.Google.
11
12
 
 
13
Portions of this file contain modifications contributed and copyrighted by
 
14
Sun Microsystems, Inc. Those modifications are gratefully acknowledged and
 
15
are described briefly in the InnoDB documentation. The contributions by
 
16
Sun Microsystems are incorporated with their permission, and subject to the
 
17
conditions contained in the file COPYING.Sun_Microsystems.
 
18
 
12
19
This program is free software; you can redistribute it and/or modify it under
13
20
the terms of the GNU General Public License as published by the Free Software
14
21
Foundation; version 2 of the License.
23
30
 
24
31
*****************************************************************************/
25
32
 
26
 
/***************************************************************************
 
33
/***********************************************************************//**
 
34
@file include/univ.i
27
35
Version control for database, common definitions, and include files
28
36
 
29
37
Created 1/20/1994 Heikki Tuuri
32
40
#ifndef univ_i
33
41
#define univ_i
34
42
 
35
 
#if ( defined(sun) || defined(__sun) )
36
 
# include <sun_prefetch.h>
37
 
#endif
 
43
#include "config.h"
38
44
 
39
45
#ifndef __cplusplus
40
46
# include <stdbool.h>
41
47
#endif
42
48
 
 
49
#ifdef UNIV_HOTBACKUP
 
50
#include "hb_univ.i"
 
51
#endif /* UNIV_HOTBACKUP */
 
52
 
43
53
#define INNODB_VERSION_MAJOR    1
44
54
#define INNODB_VERSION_MINOR    0
45
 
#define INNODB_VERSION_BUGFIX   3
 
55
#define INNODB_VERSION_BUGFIX   4
46
56
 
47
57
/* The following is the InnoDB version as shown in
48
58
SELECT plugin_version FROM information_schema.plugins;
62
72
                        INNODB_VERSION_MINOR,   \
63
73
                        INNODB_VERSION_BUGFIX)
64
74
 
 
75
#define REFMAN "http://dev.mysql.com/doc/refman/5.1/en/"
 
76
 
65
77
#ifdef MYSQL_DYNAMIC_PLUGIN
66
78
/* In the dynamic plugin, redefine some externally visible symbols
67
79
in order not to conflict with the symbols of a builtin InnoDB. */
78
90
 
79
91
# include <windows.h>
80
92
 
81
 
# if !defined(WIN64) && !defined(_WIN64)
82
 
#  define UNIV_CAN_USE_X86_ASSEMBLER
83
 
# endif
 
93
# if defined(HAVE_WINDOWS_ATOMICS)
 
94
/* If atomics are defined we use them in InnoDB mutex implementation */
 
95
#  define HAVE_ATOMIC_BUILTINS
 
96
# endif /* HAVE_WINDOWS_ATOMICS */
84
97
 
85
98
# ifdef _NT_
86
99
#  define __NT__
94
107
if we are compiling on Windows. */
95
108
 
96
109
# if defined(BUILD_DRIZZLE)
97
 
#  include <drizzled/global.h>
98
110
#  include <mysys/my_pthread.h>
99
111
# else
100
 
#  include <my_global.h>
101
 
#  include <my_pthread.h>
 
112
#  ifndef UNIV_HOTBACKUP
 
113
#   include <my_global.h>
 
114
#   include <my_pthread.h>
 
115
#  endif /* UNIV_HOTBACKUP */
102
116
# endif
103
117
 
104
118
/* Include <sys/stat.h> to get S_I... macros defined for os0file.c */
112
126
 
113
127
/* Include the header file generated by GNU autoconf */
114
128
# if !defined(__WIN__) && !defined(BUILD_DRIZZLE)
115
 
#  include <config.h>
 
129
#  ifndef UNIV_HOTBACKUP
 
130
#   include <config.h>
 
131
#  endif /* UNIV_HOTBACKUP */
116
132
# endif
117
133
 
118
134
# ifdef HAVE_SCHED_H
119
135
#  include <sched.h>
120
136
# endif
121
137
 
122
 
/* When compiling for Itanium IA64, undefine the flag below to prevent use
123
 
of the 32-bit x86 assembler in mutex operations. */
124
 
 
125
 
# if defined(__WIN__) && !defined(WIN64) && !defined(_WIN64)
126
 
#  define UNIV_CAN_USE_X86_ASSEMBLER
127
 
# endif
 
138
# if defined(HAVE_GCC_ATOMIC_BUILTINS) || defined(HAVE_SOLARIS_ATOMICS) \
 
139
     || defined(HAVE_WINDOWS_ATOMICS)
 
140
/* If atomics are defined we use them in InnoDB mutex implementation */
 
141
#  define HAVE_ATOMIC_BUILTINS
 
142
# endif /* (HAVE_GCC_ATOMIC_BUILTINS) || (HAVE_SOLARIS_ATOMICS)
 
143
        || (HAVE_WINDOWS_ATOMICS) */
128
144
 
129
145
/* For InnoDB rw_locks to work with atomics we need the thread_id
130
146
to be no more than machine word wide. The following enables using
131
147
atomics for InnoDB rw_locks where these conditions are met. */
132
 
#ifdef HAVE_GCC_ATOMIC_BUILTINS
 
148
#ifdef HAVE_ATOMIC_BUILTINS
133
149
/* if HAVE_ATOMIC_PTHREAD_T is defined at this point that means that
134
150
the code from plug.in has defined it and we do not need to include
135
151
ut0auxconf.h which would either define HAVE_ATOMIC_PTHREAD_T or will
142
158
# ifdef HAVE_ATOMIC_PTHREAD_T
143
159
#  define INNODB_RW_LOCKS_USE_ATOMICS
144
160
# endif /* HAVE_ATOMIC_PTHREAD_T */
145
 
#endif /* HAVE_GCC_ATOMIC_BUILTINS */
 
161
#endif /* HAVE_ATOMIC_BUILTINS */
146
162
 
147
163
/* We only try to do explicit inlining of functions with gcc and
148
 
Microsoft Visual C++ */
 
164
Sun Studio */
149
165
 
150
 
# if !defined(__GNUC__)
 
166
# if !defined(__GNUC__) && !(defined(__SUNPRO_C) || defined(__SUNPRO_CC))
151
167
#  undef  UNIV_MUST_NOT_INLINE                  /* Remove compiler warning */
152
168
#  define UNIV_MUST_NOT_INLINE
153
169
# endif
255
271
/* Definition for inline version */
256
272
 
257
273
#ifdef __WIN__
258
 
#define UNIV_INLINE     __inline
 
274
# define UNIV_INLINE    __inline
 
275
#elif defined(__SUNPRO_CC) || defined(__SUNPRO_C)
 
276
# define UNIV_INLINE static inline
259
277
#else
260
 
#define UNIV_INLINE static __inline__
 
278
# define UNIV_INLINE static __inline__
261
279
#endif
262
280
 
263
281
#else
334
352
#ifdef __WIN__
335
353
typedef __int64                 ib_int64_t;
336
354
typedef unsigned __int64        ib_uint64_t;
337
 
#else
 
355
#elif !defined(UNIV_HOTBACKUP)
338
356
/* Note: longlong and ulonglong come from MySQL headers. */
339
357
# if defined(BUILD_DRIZZLE)
340
358
typedef int64_t                 ib_int64_t;
349
367
# endif // DRIZZLE
350
368
#endif
351
369
 
 
370
#ifndef UNIV_HOTBACKUP
352
371
typedef unsigned long long int  ullint;
 
372
#endif /* UNIV_HOTBACKUP */
353
373
 
354
374
#ifndef __WIN__
355
375
#if SIZEOF_LONG != SIZEOF_VOIDP
407
427
/* Minimize cache-miss latency by moving data at addr into a cache before
408
428
it is read or written. */
409
429
# define UNIV_PREFETCH_RW(addr) __builtin_prefetch(addr, 1, 3)
410
 
#elif ( defined(sun) || defined(__sun) )
 
430
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
 
431
# include <sun_prefetch.h>
 
432
#if __SUNPRO_C >= 0x550
 
433
# undef UNIV_INTERN
 
434
# define UNIV_INTERN __hidden
 
435
#endif /* __SUNPRO_C >= 0x550 */
 
436
/* Use sun_prefetch when compile with Sun Studio */
411
437
# define UNIV_EXPECT(expr,value) (expr)
412
438
# define UNIV_LIKELY_NULL(expr) (expr)
413
439
# define UNIV_PREFETCH_R(addr) sun_prefetch_read_many((void *)(addr))