mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / storage / ndb / test / ndbapi / bench / macros.h
blob85ce53e91dfb1b90442394eceb7d8e0e1b1f518b
1 /* Copyright (c) 2003, 2005 MySQL AB
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
16 #ifndef MACROS_H
17 #define MACROS_H
19 #include <ndb_global.h>
20 #include <NdbOut.hpp>
22 #define ERROR(x) {ndbout_c((x));}
23 #define ERROR1(x,y) {ndbout_c((x), (y));}
24 #define ERROR2(x,y,z) {ndbout_c((x), (y), (z));}
25 #define ERROR3(x,y,z,u) {ndbout_c((x), (y), (z), (u));}
26 #define ERROR4(x,y,z,u,w) {ndbout_c((x), (y), (z), (u), (w));}
28 #define INIT_RANDOM(x) srand48((x))
29 #define UI_RANDOM(x) ((unsigned int)(lrand48()%(x)))
31 #define ASSERT(cond, message) \
32 { if(!(cond)) { ERROR(message); exit(-1); }}
34 #ifdef DEBUG_ON
35 #define DEBUG(x) {ndbout_c((x));}
36 #define DEBUG1(x,y) {ndbout_c((x), (y));}
37 #define DEBUG2(x,y,z) {ndbout_c((x), (y), (z));}
38 #define DEBUG3(x,y,z,u) {ndbout_c((x), (y), (z), (u));}
39 #define DEBUG4(x,y,z,u,w) {ndbout_c((x), (y), (z), (u), (w));}
40 #define DEBUG5(x,y,z,u,w, v) {ndbout_c((x), (y), (z), (u), (w), (v));}
41 #else
42 #define DEBUG(x)
43 #define DEBUG1(x,y)
44 #define DEBUG2(x,y,z)
45 #define DEBUG3(x,y,z,u)
46 #define DEBUG4(x,y,z,u,w)
47 #define DEBUG5(x,y,z,u,w, v)
48 #endif
50 #endif