~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/util/test.h

  • Committer: Lee Bieber
  • Date: 2011-03-29 22:31:41 UTC
  • mfrom: (2257.1.3 build)
  • Revision ID: kalebral@gmail.com-20110329223141-yxc22h3l2he58sk0
Merge Andrew - 743842: Build failure using GCC 4.6
Merge Stewart - 738022: CachedDirectory silently fails to add entries if stat() fails
Merge Olaf - Common fwd: add copyright, add more declaration

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#ifndef DRIZZLED_UTIL_TEST_H
22
 
#define DRIZZLED_UTIL_TEST_H
23
 
 
24
 
#if defined(__cplusplus)
25
 
 
26
 
namespace drizzled
27
 
{
 
21
#pragma once
 
22
 
 
23
namespace drizzled {
28
24
 
29
25
template <class T>
30
 
inline bool test(const T a)
 
26
bool test(const T a)
31
27
{
32
 
  return a ? true : false;
 
28
  return a;
33
29
}
34
30
 
35
31
template <class T, class U>
36
 
inline bool test_all_bits(const T a, const U b)
 
32
bool test_all_bits(const T a, const U b)
37
33
{
38
 
  return ((a & b) == b);
 
34
  return (a & b) == b;
39
35
}
40
36
 
41
37
} /* namespace drizzled */
42
38
 
43
 
#else
44
 
# define test(a)    ((a) ? 1 : 0)
45
 
# define test_all_bits(a,b) (((a) & (b)) == (b))
46
 
#endif
47
 
 
48
 
#endif /* DRIZZLED_UTIL_TEST_H */