~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/global.h

  • Committer: Monty Taylor
  • Date: 2008-10-09 22:38:27 UTC
  • mto: This revision was merged to the branch mainline in revision 497.
  • Revision ID: monty@inaugust.com-20081009223827-bc9gvpiplsmvpwyq
Moved test() to its own file.
Made a new function to possibly replace int10_to_str.

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)