diff options
Diffstat (limited to 'ndb/test/ndbapi/flexTT.cpp')
-rw-r--r-- | ndb/test/ndbapi/flexTT.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/ndb/test/ndbapi/flexTT.cpp b/ndb/test/ndbapi/flexTT.cpp index 71d5b6c096e..4373102f77e 100644 --- a/ndb/test/ndbapi/flexTT.cpp +++ b/ndb/test/ndbapi/flexTT.cpp @@ -35,7 +35,14 @@ #define MAXSTRLEN 16 #define MAXATTR 64 #define MAXTABLES 64 -#define MAXTHREADS 128 +#define NDB_MAXTHREADS 128 +/* + NDB_MAXTHREADS used to be just MAXTHREADS, which collides with a + #define from <sys/thread.h> on AIX (IBM compiler). We explicitly + #undef it here lest someone use it by habit and get really funny + results. K&R says we may #undef non-existent symbols, so let's go. +*/ +#undef MAXTHREADS #define MAXPAR 1024 #define MAXATTRSIZE 1000 #define PKSIZE 1 @@ -101,10 +108,10 @@ static void input_error(); ErrorData * flexTTErrorData; -static NdbThread* threadLife[MAXTHREADS]; +static NdbThread* threadLife[NDB_MAXTHREADS]; static int tNodeId; -static int ThreadReady[MAXTHREADS]; -static StartType ThreadStart[MAXTHREADS]; +static int ThreadReady[NDB_MAXTHREADS]; +static StartType ThreadStart[NDB_MAXTHREADS]; static char tableName[1][MAXSTRLEN+1]; static char attrName[5][MAXSTRLEN+1]; @@ -184,7 +191,7 @@ NDB_COMMAND(flexTT, "flexTT", "flexTT", "flexTT", 65535) return NDBT_ProgramExit(NDBT_WRONGARGS); } - pThreadData = new ThreadNdb[MAXTHREADS]; + pThreadData = new ThreadNdb[NDB_MAXTHREADS]; ndbout << endl << "FLEXTT - Starting normal mode" << endl; ndbout << "Perform TimesTen benchmark" << endl; @@ -798,7 +805,7 @@ readArguments(int argc, const char** argv){ while (argc > 1){ if (strcmp(argv[i], "-t") == 0){ tNoOfThreads = atoi(argv[i+1]); - if ((tNoOfThreads < 1) || (tNoOfThreads > MAXTHREADS)){ + if ((tNoOfThreads < 1) || (tNoOfThreads > NDB_MAXTHREADS)){ ndbout_c("Invalid no of threads"); return -1; } |