de-lint. disable c++ parentheses warnings. fix casts in AROSPDFApp.cc
[AROS-Contrib.git] / regina / mt.h
blob663c1ce95e2cf55448b70b088111bf37d8357572
1 #ifndef MT_H_INCLUDED
2 #define MT_H_INCLUDED
4 #include <setjmp.h>
6 struct _OS_Dep_funcs;
8 /* tsd_t holds all global vars which may change between threads as expected.*/
9 typedef struct _tsd_t {
10 void * mem_tsd ; /* local variables of memory.c */
11 void * var_tsd ; /* local variables of variable.c */
12 void * stk_tsd ; /* local variables of stack.c */
13 void * fil_tsd ; /* local variables of files.c */
14 void * itp_tsd ; /* local variables of interprt.c */
15 void * tra_tsd ; /* local variables of tracing.c */
16 void * err_tsd ; /* local variables of error.c */
17 void * vms_tsd ; /* local variables of vmscmd.c */
18 void * bui_tsd ; /* local variables of builtin.c */
19 void * vmf_tsd ; /* local variables of vmsfuncs.c */
20 void * lib_tsd ; /* local variables of library.c */
21 void * rex_tsd ; /* local variables of rexxsaa.c */
22 void * shl_tsd ; /* local variables of shell.c */
23 void * mat_tsd ; /* local variables of strmath.c */
24 void * cli_tsd ; /* local variables of client.c */
25 void * ami_tsd ; /* local variables of amigafuncs.c */
26 void * arx_tsd ; /* local variables of arexxfuncs.c */
27 void * mt_tsd ; /* local variables of mt_???.c */
29 void * CH; /* only rexxsaa.c */
30 int indentsize; /* only in r2perl.c */
31 int loopcnt; /* only in r2perl.c */
32 paramboxptr listleaked_params ; /* only in funcs.c */
33 paramboxptr par_stack ; /* only in funcs.c */
34 int traceparse ; /* only in parsing.c */
35 num_descr rdes; /* only in expr.c */
36 num_descr ldes; /* only in expr.c */
37 void * firstenvir; /* only in envir.c */
38 void * last_alloca_header; /* only in alloca.c */
39 void * stkaddr; /* only in alloca.c */
40 volatile char * tmp_strs[8]; /* only tmpstr_of() */
41 int next_tmp_str; /* only tmpstr_of() */
42 paramboxptr bif_first ; /* only builtinfunc() */
43 void * firstmacro ; /* only in macros.c */
45 sysinfo systeminfo ;
46 proclevel currlevel ;
47 int listleakedmemory ;
48 int var_indicator ;
49 int isclient ;
50 nodeptr currentnode ;
51 sigtype * nextsig;
52 FILE * stddump;
53 unsigned long thread_id;
54 int instore_is_errorfree;
55 char trace_stat;
56 int called_from_saa;
57 int restricted;
58 /* Stuff for a delayed exit()/setjmp(): */
59 int in_protected;
60 jmp_buf protect_return;
61 jmp_buf gci_jump;
62 volatile delayed_error_type_t delayed_error_type;
63 volatile int expected_exit_error;
64 /* call exit() with this value if
65 * delayed_error_type is PROTECTED_DelayedScriptExit
67 volatile int HaltRaised;
68 void * (*MTMalloc)(const struct _tsd_t *TSD,size_t size);
69 void (*MTFree)(const struct _tsd_t *TSD,void *chunk);
70 void (*MTExit)(int code);
71 char gci_prefix[2];
72 const char *BIFname;
73 void *BIFfunc;
74 struct _OS_Dep_funcs *OS;
75 } tsd_t;
77 #if (defined(POSIX) || defined(_POSIX_SOURCE) || defined(_PTHREAD_SEMANTICS)) && (defined(_REENTRANT) || defined(REENTRANT))
78 # include "mt_posix.h"
79 #elif defined(_WIN64) && defined(REGINA_SINGLE_THREADED)
80 # include "mt_notmt.h"
81 # define SINGLE_THREADED
82 #elif defined(_WIN64) && defined(_MT)
83 # include "mt_win32.h"
84 #elif defined(_WIN32) && defined(_MT)
85 # include "mt_win32.h"
86 #elif defined(OS2) && defined(__EMX__) && defined(__MT__) && defined(REGINA_MULTI)
87 # include "mt_os2.h"
88 #elif defined(OS2) && defined(__WATCOMC__) && defined(REGINA_MULTI)
89 # include "mt_os2.h"
90 #elif (defined(__AROS__) || defined(_AMIGA)) && defined(RXLIB)
91 # include "mt_amigalib.h"
92 #else
93 # include "mt_notmt.h"
94 # if !defined(SINGLE_THREADED) && !defined(MULTI_THREADED)
95 # define SINGLE_THREADED
96 # endif
97 #endif
99 /* SINGLE_THREAD is defined explicitely, thus: */
100 #if !defined(SINGLE_THREADED) && !defined(MULTI_THREADED)
101 # define MULTI_THREADED
102 #endif
104 #endif /* MT_H_INCLUDED */