~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to include/my_global.h

Merged in Jay's tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
/* Make it easier to add conditionl code for windows */
59
59
#define IF_WIN(A,B) (B)
60
60
 
61
 
/* Some defines to avoid ifdefs in the code */
62
 
#ifndef NETWARE_YIELD
63
 
#define NETWARE_YIELD
64
 
#define NETWARE_SET_SCREEN_MODE(A)
65
 
#endif
66
 
 
67
 
 
68
61
/*
69
62
  The macros below are borrowed from include/linux/compiler.h in the
70
63
  Linux kernel. Use them to indicate the likelyhood of the truthfulness
112
105
#endif
113
106
 
114
107
/*
115
 
  The following macro is used to ensure that code often used in most
116
 
  SQL statements and definitely for parts of the SQL processing are
117
 
  kept in a code segment by itself. This has the advantage that the
118
 
  risk of common code being overlapping in caches of the CPU is less.
119
 
  This can be a cause of big performance problems.
120
 
  Routines should be put in this category with care and when they are
121
 
  put there one should also strive to make as much of the error handling
122
 
  as possible (or uncommon code of the routine) to execute in a
123
 
  separate method to avoid moving to much code to this code segment.
124
 
 
125
 
  It is very easy to use, simply add HOT_METHOD at the end of the
126
 
  function declaration.
127
 
  For more input see GCC manual (available in GCC 2.95 and later)
128
 
*/
129
 
 
130
 
#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR > 94)
131
 
#define HOT_METHOD \
132
 
  __attribute__ ((section ("hot_code_section")))
133
 
#else
134
 
#define HOT_METHOD
135
 
#endif
136
 
 
137
 
/*
138
 
  The following macro is used to ensure that popular global variables
139
 
  are located next to each other to avoid that they contend for the
140
 
  same cache lines.
141
 
 
142
 
  It is very easy to use, simply add HOT_DATA at the end of the declaration
143
 
  of the variable, the variable must be initialised because of the way
144
 
  that linker works so a declaration using HOT_DATA should look like:
145
 
  uint global_hot_data HOT_DATA = 0;
146
 
  For more input see GCC manual (available in GCC 2.95 and later)
147
 
*/
148
 
 
149
 
#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR > 94)
150
 
#define HOT_DATA \
151
 
  __attribute__ ((section ("hot_data_section")))
152
 
#else
153
 
#define HOT_DATA
154
 
#endif
155
 
 
156
 
/*
157
108
  now let's figure out if inline functions are supported
158
109
  autoconf defines 'inline' to be empty, if not
159
110
*/
353
304
#define MASTER 1                /* Compile without unireg */
354
305
#define ENGLISH 1               /* Messages in English */
355
306
#define POSIX_MISTAKE 1         /* regexp: Fix stupid spec error */
356
 
#define USE_REGEX 1             /* We want the use the regex library */
357
307
/* Do not define for ultra sparcs */
358
308
#define USE_BMOVE512 1          /* Use this unless system bmove is faster */
359
309
 
395
345
#define rint(A) floor((A)+(((A) < 0)? -0.5 : 0.5))
396
346
#endif
397
347
 
398
 
/* Define some general constants */
399
 
#ifndef TRUE
400
 
#define TRUE            (1)     /* Logical true */
401
 
#define FALSE           (0)     /* Logical false */
402
 
#endif
403
 
 
404
348
#if defined(__GNUC__)
405
349
#define function_volatile       volatile
406
350
#define my_reinterpret_cast(A) reinterpret_cast<A>
549
493
 
550
494
        /* Some things that this system doesn't have */
551
495
 
552
 
#define NO_HASH                 /* Not needed anymore */
553
 
 
554
496
/* Some defines of functions for portability */
555
497
 
556
498
#undef remove           /* Crashes MySQL on SCO 5.0.0 */
574
516
#define strtok_r(A,B,C) strtok((A),(B))
575
517
#endif
576
518
 
577
 
 
578
 
#if defined(INT64_MAX)
579
 
#define LONGLONG_MAX INT64_MAX
580
 
#endif
581
 
 
582
 
#if defined(INT64_MIN)
583
 
#define LONGLONG_MIN INT64_MIN
584
 
#endif
585
 
 
586
 
#if !defined(ULONGLONG_MAX)
587
 
/* First check for ANSI C99 definition: */
588
 
#if defined(UINT64_MAX)
589
 
#define ULONGLONG_MAX  UINT64_MAX
590
 
#else
591
 
#define ULONGLONG_MAX ((uint64_t)(~0ULL))
592
 
#endif
593
 
#endif /* !defined(ULONGLONG_MAX)*/
594
 
 
595
 
#define INT_MIN32       (~0x7FFFFFFFL)
596
 
#define INT_MAX32       0x7FFFFFFFL
597
 
#define UINT_MAX32      0xFFFFFFFFL
598
 
#define INT_MIN24       (~0x007FFFFF)
599
 
#define INT_MAX24       0x007FFFFF
600
 
#define UINT_MAX24      0x00FFFFFF
601
 
#define INT_MIN16       (~0x7FFF)
602
 
#define INT_MAX16       0x7FFF
603
 
#define UINT_MAX16      0xFFFF
604
 
#define INT_MIN8        (~0x7F)
605
 
#define INT_MAX8        0x7F
606
 
#define UINT_MAX8       0xFF
607
 
 
608
519
#ifdef HAVE_FLOAT_H
609
520
#include <float.h>
610
521
#else