~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to include/config-win.h

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
 
2
 
 
3
   This program is free software; you can redistribute it and/or modify
 
4
   it under the terms of the GNU General Public License as published by
 
5
   the Free Software Foundation; version 2 of the License.
 
6
 
 
7
   This program is distributed in the hope that it will be useful,
 
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
   GNU General Public License for more details.
 
11
 
 
12
   You should have received a copy of the GNU General Public License
 
13
   along with this program; if not, write to the Free Software
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
/* Defines for Win32 to make it compatible for MySQL */
 
17
 
 
18
#define BIG_TABLES
 
19
 
 
20
#if defined(_MSC_VER) && _MSC_VER >= 1400
 
21
/* Avoid endless warnings about sprintf() etc. being unsafe. */
 
22
#define _CRT_SECURE_NO_DEPRECATE 1
 
23
#endif
 
24
 
 
25
#include <sys/locking.h>
 
26
#include <winsock2.h>
 
27
#include <fcntl.h>
 
28
#include <io.h>
 
29
#include <malloc.h>
 
30
 
 
31
#define HAVE_SMEM 1
 
32
 
 
33
#if defined(_WIN64) || defined(WIN64) 
 
34
#define SYSTEM_TYPE     "Win64" 
 
35
#elif defined(_WIN32) || defined(WIN32) 
 
36
#define SYSTEM_TYPE     "Win32" 
 
37
#else
 
38
#define SYSTEM_TYPE     "Windows"
 
39
#endif
 
40
 
 
41
#if defined(_M_IA64) 
 
42
#define MACHINE_TYPE    "ia64" 
 
43
#elif defined(_M_IX86) 
 
44
#define MACHINE_TYPE    "ia32" 
 
45
#elif defined(_M_ALPHA) 
 
46
#define MACHINE_TYPE    "axp" 
 
47
#else
 
48
#define MACHINE_TYPE    "unknown"       /* Define to machine type name */
 
49
#endif 
 
50
 
 
51
#if !(defined(_WIN64) || defined(WIN64)) 
 
52
#ifndef _WIN32
 
53
#define _WIN32                          /* Compatible with old source */
 
54
#endif
 
55
#ifndef __WIN32__
 
56
#define __WIN32__
 
57
#endif
 
58
#endif /* _WIN64 */
 
59
#ifndef __WIN__
 
60
#define __WIN__                       /* To make it easier in VC++ */
 
61
#endif
 
62
 
 
63
#ifndef MAX_INDEXES
 
64
#define MAX_INDEXES 64
 
65
#endif
 
66
 
 
67
/* File and lock constants */
 
68
#define O_SHARE         0x1000          /* Open file in sharing mode */
 
69
#ifdef __BORLANDC__
 
70
#define F_RDLCK         LK_NBLCK        /* read lock */
 
71
#define F_WRLCK         LK_NBRLCK       /* write lock */
 
72
#define F_UNLCK         LK_UNLCK        /* remove lock(s) */
 
73
#else
 
74
#define F_RDLCK         _LK_NBLCK       /* read lock */
 
75
#define F_WRLCK         _LK_NBRLCK      /* write lock */
 
76
#define F_UNLCK         _LK_UNLCK       /* remove lock(s) */
 
77
#endif
 
78
 
 
79
#define F_EXCLUSIVE     1               /* We have only exclusive locking */
 
80
#define F_TO_EOF        (INT_MAX32/2)   /* size for lock of all file */
 
81
#define F_OK            0               /* parameter to access() */
 
82
#define W_OK            2
 
83
 
 
84
#define S_IROTH         S_IREAD         /* for my_lib */
 
85
 
 
86
#ifdef __BORLANDC__
 
87
#define FILE_BINARY     O_BINARY        /* my_fopen in binary mode */
 
88
#define O_TEMPORARY     0
 
89
#define O_SHORT_LIVED   0
 
90
#define SH_DENYNO       _SH_DENYNO
 
91
#else
 
92
#define O_BINARY        _O_BINARY       /* compability with older style names */
 
93
#define FILE_BINARY     _O_BINARY       /* my_fopen in binary mode */
 
94
#define O_TEMPORARY     _O_TEMPORARY
 
95
#define O_SHORT_LIVED   _O_SHORT_LIVED
 
96
#define SH_DENYNO       _SH_DENYNO
 
97
#endif
 
98
#define NO_OPEN_3                       /* For my_create() */
 
99
 
 
100
#define SIGQUIT         SIGTERM         /* No SIGQUIT */
 
101
 
 
102
#undef _REENTRANT                       /* Crashes something for win32 */
 
103
#undef SAFE_MUTEX                       /* Can't be used on windows */
 
104
 
 
105
#if defined(_MSC_VER) && _MSC_VER >= 1310
 
106
#define LL(A)           A##ll
 
107
#define ULL(A)          A##ull
 
108
#else
 
109
#define LL(A)           ((__int64) A)
 
110
#define ULL(A)          ((unsigned __int64) A)
 
111
#endif
 
112
 
 
113
#define LONGLONG_MIN    LL(0x8000000000000000)
 
114
#define LONGLONG_MAX    LL(0x7FFFFFFFFFFFFFFF)
 
115
#define ULONGLONG_MAX   ULL(0xFFFFFFFFFFFFFFFF)
 
116
 
 
117
/* Type information */
 
118
 
 
119
#if !defined(HAVE_UINT)
 
120
#undef HAVE_UINT
 
121
#define HAVE_UINT
 
122
typedef unsigned short  ushort;
 
123
typedef unsigned int    uint;
 
124
#endif /* !defined(HAVE_UINT) */
 
125
 
 
126
typedef unsigned __int64 ulonglong;     /* Microsofts 64 bit types */
 
127
typedef __int64 longlong;
 
128
#ifndef HAVE_SIGSET_T
 
129
typedef int sigset_t;
 
130
#endif
 
131
#define longlong_defined
 
132
/*
 
133
  off_t should not be __int64 because of conflicts in header files;
 
134
  Use my_off_t or os_off_t instead
 
135
*/
 
136
#ifndef HAVE_OFF_T
 
137
typedef long off_t;
 
138
#endif
 
139
typedef __int64 os_off_t;
 
140
#ifdef _WIN64
 
141
typedef UINT_PTR rf_SetTimer;
 
142
#else
 
143
#ifndef HAVE_SIZE_T
 
144
typedef unsigned int size_t;
 
145
#endif
 
146
typedef uint rf_SetTimer;
 
147
#endif
 
148
 
 
149
#define Socket_defined
 
150
#define my_socket SOCKET
 
151
#define SIGPIPE SIGINT
 
152
#define RETQSORTTYPE void
 
153
#define QSORT_TYPE_IS_VOID
 
154
#define RETSIGTYPE void
 
155
#define SOCKET_SIZE_TYPE int
 
156
#define my_socket_defined
 
157
#define byte_defined
 
158
#define HUGE_PTR
 
159
#define STDCALL __stdcall           /* Used by libmysql.dll */
 
160
#define isnan(X) _isnan(X)
 
161
#define finite(X) _finite(X)
 
162
 
 
163
#ifndef MYSQL_CLIENT_NO_THREADS
 
164
#define THREAD
 
165
#endif
 
166
#define VOID_SIGHANDLER
 
167
#define SIZEOF_CHAR             1
 
168
#define SIZEOF_INT              4
 
169
#define SIZEOF_LONG             4
 
170
#define SIZEOF_LONG_LONG        8
 
171
#define SIZEOF_OFF_T            8
 
172
#ifdef _WIN64
 
173
#define SIZEOF_CHARP            8
 
174
#else
 
175
#define SIZEOF_CHARP            4
 
176
#endif
 
177
#define HAVE_BROKEN_NETINET_INCLUDES
 
178
#ifdef __NT__
 
179
#define HAVE_NAMED_PIPE                 /* We can only create pipes on NT */
 
180
#endif
 
181
 
 
182
/* ERROR is defined in wingdi.h */
 
183
#undef ERROR
 
184
 
 
185
/* We need to close files to break connections on shutdown */
 
186
#ifndef SIGNAL_WITH_VIO_CLOSE
 
187
#define SIGNAL_WITH_VIO_CLOSE
 
188
#endif
 
189
 
 
190
/* All windows servers should support .sym files */
 
191
#undef USE_SYMDIR
 
192
#define USE_SYMDIR
 
193
 
 
194
/* If LOAD DATA LOCAL INFILE should be enabled by default */
 
195
#define ENABLED_LOCAL_INFILE 1
 
196
 
 
197
/* If query profiling should be enabled by default */
 
198
#define ENABLED_PROFILING 1
 
199
 
 
200
/* Convert some simple functions to Posix */
 
201
 
 
202
#define my_sigset(A,B) signal((A),(B))
 
203
#define finite(A) _finite(A)
 
204
#define sleep(A)  Sleep((A)*1000)
 
205
#define popen(A,B) _popen((A),(B))
 
206
#define pclose(A) _pclose(A)
 
207
 
 
208
#ifndef __BORLANDC__
 
209
#define access(A,B) _access(A,B)
 
210
#endif
 
211
 
 
212
#if !defined(__cplusplus)
 
213
#define inline __inline
 
214
#endif /* __cplusplus */
 
215
 
 
216
#ifdef _WIN64
 
217
#define ulonglong2double(A) ((double) (ulonglong) (A))
 
218
#define my_off_t2double(A)  ((double) (my_off_t) (A))
 
219
 
 
220
#else
 
221
inline double ulonglong2double(ulonglong value)
 
222
{
 
223
  longlong nr=(longlong) value;
 
224
  if (nr >= 0)
 
225
    return (double) nr;
 
226
  return (18446744073709551616.0 + (double) nr);
 
227
}
 
228
#define my_off_t2double(A) ulonglong2double(A)
 
229
#endif /* _WIN64 */
 
230
 
 
231
inline ulonglong double2ulonglong(double d)
 
232
{
 
233
  double t= d - (double) 0x8000000000000000ULL;
 
234
 
 
235
  if (t >= 0)
 
236
    return  ((ulonglong) t) + 0x8000000000000000ULL;
 
237
  return (ulonglong) d;
 
238
}
 
239
 
 
240
#if SIZEOF_OFF_T > 4
 
241
#define lseek(A,B,C) _lseeki64((A),(longlong) (B),(C))
 
242
#define tell(A) _telli64(A)
 
243
#endif
 
244
 
 
245
#define STACK_DIRECTION -1
 
246
 
 
247
/* Difference between GetSystemTimeAsFileTime() and now() */
 
248
#define OFFSET_TO_EPOCH ULL(116444736000000000)
 
249
 
 
250
#define HAVE_PERROR
 
251
#define HAVE_VFPRINT
 
252
#define HAVE_RENAME             /* Have rename() as function */
 
253
#define HAVE_BINARY_STREAMS     /* Have "b" flag in streams */
 
254
#define HAVE_LONG_JMP           /* Have long jump function */
 
255
#define HAVE_LOCKING            /* have locking() call */
 
256
#define HAVE_ERRNO_AS_DEFINE    /* errno is a define */
 
257
#define HAVE_STDLIB             /* everything is include in this file */
 
258
#define HAVE_MEMCPY
 
259
#define HAVE_MEMMOVE
 
260
#define HAVE_GETCWD
 
261
#define HAVE_TELL
 
262
#define HAVE_TZNAME
 
263
#define HAVE_PUTENV
 
264
#define HAVE_SELECT
 
265
#define HAVE_SETLOCALE
 
266
#define HAVE_SOCKET             /* Giangi */
 
267
#define HAVE_FLOAT_H
 
268
#define HAVE_LIMITS_H
 
269
#define HAVE_STDDEF_H
 
270
#define NO_FCNTL_NONBLOCK       /* No FCNTL */
 
271
#define HAVE_ALLOCA
 
272
#define HAVE_STRPBRK
 
273
#define HAVE_STRSTR
 
274
#define HAVE_COMPRESS
 
275
#define HAVE_CREATESEMAPHORE
 
276
#define HAVE_ISNAN
 
277
#define HAVE_FINITE
 
278
#define HAVE_QUERY_CACHE
 
279
#define SPRINTF_RETURNS_INT
 
280
#define HAVE_SETFILEPOINTER
 
281
#define HAVE_VIO_READ_BUFF
 
282
#if defined(_MSC_VER) && _MSC_VER >= 1400
 
283
/* strnlen() appeared in Studio 2005 */
 
284
#define HAVE_STRNLEN
 
285
#endif
 
286
#define HAVE_WINSOCK2
 
287
 
 
288
#define strcasecmp stricmp
 
289
#define strncasecmp strnicmp
 
290
 
 
291
#ifndef __NT__
 
292
#undef FILE_SHARE_DELETE
 
293
#define FILE_SHARE_DELETE 0     /* Not implemented on Win 98/ME */
 
294
#endif
 
295
 
 
296
#ifdef NOT_USED
 
297
#define HAVE_SNPRINTF           /* Gave link error */
 
298
#define _snprintf snprintf
 
299
#endif
 
300
 
 
301
#ifdef _MSC_VER
 
302
#define HAVE_LDIV               /* The optimizer breaks in zortech for ldiv */
 
303
#define HAVE_ANSI_INCLUDE
 
304
#define HAVE_SYS_UTIME_H
 
305
#define HAVE_STRTOUL
 
306
#endif
 
307
#define my_reinterpret_cast(A) reinterpret_cast <A>
 
308
#define my_const_cast(A) const_cast<A>
 
309
 
 
310
 
 
311
/* MYSQL OPTIONS */
 
312
 
 
313
#ifdef _CUSTOMCONFIG_
 
314
#include <custom_conf.h>
 
315
#else
 
316
#ifndef CMAKE_CONFIGD
 
317
#define DEFAULT_MYSQL_HOME      "c:\\mysql"
 
318
#define MYSQL_DATADIR          "c:\\mysql\\data"
 
319
#define PACKAGE                 "mysql"
 
320
#define DEFAULT_BASEDIR         "C:\\"
 
321
#define SHAREDIR                "share"
 
322
#define DEFAULT_CHARSET_HOME    "C:/mysql/"
 
323
#endif
 
324
#endif
 
325
#ifndef DEFAULT_HOME_ENV
 
326
#define DEFAULT_HOME_ENV MYSQL_HOME
 
327
#endif
 
328
#ifndef DEFAULT_GROUP_SUFFIX_ENV
 
329
#define DEFAULT_GROUP_SUFFIX_ENV MYSQL_GROUP_SUFFIX
 
330
#endif
 
331
 
 
332
/* File name handling */
 
333
 
 
334
#define FN_LIBCHAR      '\\'
 
335
#define FN_ROOTDIR      "\\"
 
336
#define FN_DEVCHAR      ':'
 
337
#define FN_NETWORK_DRIVES       /* Uses \\ to indicate network drives */
 
338
#define FN_NO_CASE_SENCE        /* Files are not case-sensitive */
 
339
#define OS_FILE_LIMIT   2048
 
340
 
 
341
#define DO_NOT_REMOVE_THREAD_WRAPPERS
 
342
#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
 
343
#define thread_safe_decrement(V,L) InterlockedDecrement((long*) &(V))
 
344
/* The following is only used for statistics, so it should be good enough */
 
345
#ifdef __NT__  /* This should also work on Win98 but .. */
 
346
#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C))
 
347
#define thread_safe_sub(V,C,L) InterlockedExchangeAdd((long*) &(V),-(long) (C))
 
348
#endif
 
349
 
 
350
#define shared_memory_buffer_length 16000
 
351
#define default_shared_memory_base_name "MYSQL"
 
352
 
 
353
#define HAVE_SPATIAL 1
 
354
#define HAVE_RTREE_KEYS 1
 
355
 
 
356
#define HAVE_OPENSSL 1
 
357
#define HAVE_YASSL 1
 
358
 
 
359
#define COMMUNITY_SERVER 1
 
360
#define ENABLED_PROFILING 1
 
361
 
 
362
/*
 
363
  Our Windows binaries include all character sets which MySQL supports.
 
364
  Any changes to the available character sets must also go into
 
365
  config/ac-macros/character_sets.m4
 
366
*/
 
367
 
 
368
#define MYSQL_DEFAULT_CHARSET_NAME "latin1"
 
369
#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
 
370
 
 
371
#define USE_MB 1
 
372
#define USE_MB_IDENT 1
 
373
#define USE_STRCOLL 1
 
374
 
 
375
#define HAVE_CHARSET_armscii8
 
376
#define HAVE_CHARSET_ascii
 
377
#define HAVE_CHARSET_big5 1
 
378
#define HAVE_CHARSET_cp1250 1
 
379
#define HAVE_CHARSET_cp1251
 
380
#define HAVE_CHARSET_cp1256
 
381
#define HAVE_CHARSET_cp1257
 
382
#define HAVE_CHARSET_cp850
 
383
#define HAVE_CHARSET_cp852
 
384
#define HAVE_CHARSET_cp866
 
385
#define HAVE_CHARSET_cp932 1
 
386
#define HAVE_CHARSET_dec8
 
387
#define HAVE_CHARSET_eucjpms 1
 
388
#define HAVE_CHARSET_euckr 1
 
389
#define HAVE_CHARSET_gb2312 1
 
390
#define HAVE_CHARSET_gbk 1
 
391
#define HAVE_CHARSET_geostd8
 
392
#define HAVE_CHARSET_greek
 
393
#define HAVE_CHARSET_hebrew
 
394
#define HAVE_CHARSET_hp8
 
395
#define HAVE_CHARSET_keybcs2
 
396
#define HAVE_CHARSET_koi8r
 
397
#define HAVE_CHARSET_koi8u
 
398
#define HAVE_CHARSET_latin1 1
 
399
#define HAVE_CHARSET_latin2 1
 
400
#define HAVE_CHARSET_latin5
 
401
#define HAVE_CHARSET_latin7
 
402
#define HAVE_CHARSET_macce
 
403
#define HAVE_CHARSET_macroman
 
404
#define HAVE_CHARSET_sjis 1
 
405
#define HAVE_CHARSET_swe7
 
406
#define HAVE_CHARSET_tis620 1
 
407
#define HAVE_CHARSET_ucs2 1
 
408
#define HAVE_CHARSET_ujis 1
 
409
#define HAVE_CHARSET_utf8 1
 
410
 
 
411
#define HAVE_UCA_COLLATIONS 1
 
412
#define HAVE_BOOL 1