FRIBParallelanalysis  1.0
FrameworkforMPIParalleldataanalysisatFRIB
TCLVersionHacks.h
1 /*
2  This header provides centralizes as many hacks as we can concerning
3  TCL API version differences.
4 */
5 #ifndef TCLVERSIONHACKS_H
6 #define TCLVERSIONHACKS_H
7 
8 #include <tcl.h>
9 #include <stdlib.h>
10 
11 
12 // tclConstCharPtr - A typedef that's either char* or const char* depending
13 // on the TCL Version:
14 
15 #if (TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >3))
16 typedef const char* tclConstCharPtr;
17 #else
18 typedef char* tclConstCharPtr;
19 #endif
20 
21 // Some older versions of TCL failed to Tcl_Free everything on unix:
22 
23 
24 static inline void
25 tclSplitListFree(void* pointer)
26 {
27 #if defined(WIN32) || (TCL_MAJOR_VERSION > 8) || \
28  ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION > 3))
29  Tcl_Free((char*)pointer);
30 #else
31  free(pointer);
32 #endif
33 }
34 
35 #endif