~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/global.h

  • Committer: Paul McCullagh
  • Date: 2008-10-10 12:42:11 UTC
  • mfrom: (499 drizzle)
  • mto: (499.1.1 codestyle)
  • mto: This revision was merged to the branch mainline in revision 505.
  • Revision ID: paul.mccullagh@primebase.org-20081010124211-hxs9ny96auxpq2ag
Merged trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
121
121
extern char _dig_vec_upper[];
122
122
extern char _dig_vec_lower[];
123
123
 
124
 
#if defined(__cplusplus)
125
 
template <class T>
126
 
inline bool test(const T a)
127
 
{
128
 
  return a ? true : false;
129
 
}
130
 
template <class T, class U>
131
 
inline bool test_all_bits(const T a, const U b)
132
 
{
133
 
  return ((a & b) == b);
134
 
}
135
 
#else
136
 
#define test(a)    ((a) ? 1 : 0)
137
 
#define test_all_bits(a,b) (((a) & (b)) == (b))
138
 
#endif
139
 
 
140
124
#define set_if_bigger(a,b)  do { if ((a) < (b)) (a)=(b); } while(0)
141
125
 
142
126
#define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0)
143
 
#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1))
144
127
#define array_elements(A) ((size_t) (sizeof(A)/sizeof(A[0])))
145
128
 
146
129
/* Some types that is different between systems */
153
136
 
154
137
/* file create flags */
155
138
 
156
 
#ifndef O_SHARE      /* Probably not windows */
157
 
#define O_SHARE    0  /* Flag to my_open for shared files */
158
 
#endif /* O_SHARE */
159
 
 
160
 
#ifndef O_BINARY
161
 
#define O_BINARY  0  /* Flag to my_open for binary files */
162
 
#endif
163
 
 
164
 
#ifndef FILE_BINARY
165
 
#define FILE_BINARY  O_BINARY /* Flag to my_fopen for binary streams */
166
 
#endif
167
 
 
168
 
#define F_TO_EOF  0L  /* Param to lockf() to lock rest of file */
169
 
 
170
139
#ifndef O_TEMPORARY
171
140
#define O_TEMPORARY  0
172
141
#endif