2 * Copyright (C) 2024 Mikulas Patocka
4 * This file is part of Ajla.
6 * Ajla is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, either version 3 of the License, or (at your option) any later
11 * Ajla is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along with
16 * Ajla. If not, see <https://www.gnu.org/licenses/>.
21 #ifdef HAVE_SYS_TYPES_H
22 #include <sys/types.h>
31 #ifdef HAVE_QUADMATH_H
55 extern extern_const
bool dll
;
57 #define EXCEPTION_RETVAL 64
60 #if defined(FILE_COMPRESSION) && !defined(POINTER_COMPRESSION_POSSIBLE)
64 #define u_name(n) cat(u_,n)
65 #define c_name(n) cat(c_,n)
67 #ifdef POINTER_COMPRESSION_POSSIBLE
68 extern uchar_efficient_t pointer_compression_enabled
;
69 #define call(n) (pointer_compression_enabled ? c_name(n) : u_name(n))
71 #define pointer_compression_enabled false
72 #define call(n) u_name(n)
76 #if !defined(FILE_COMPRESSION)
78 #define shared_init(v) = v
80 #define shared_var extern
81 #define shared_init(v)
85 #define switch_call(fn) \
86 void u_name(fn)(void); \
87 void c_name(fn)(void); \
88 static inline void fn(void) { call(fn)(); }
90 switch_call(codegen_init
)
91 switch_call(codegen_done
)
92 switch_call(data_init
)
93 switch_call(data_done
)
94 switch_call(array_index_init
)
95 switch_call(array_index_done
)
96 switch_call(function_init
)
97 switch_call(function_done
)
98 switch_call(pcode_init
)
99 switch_call(pcode_done
)
100 switch_call(save_init
)
101 switch_call(save_done
)
102 switch_call(module_init
)
103 switch_call(module_done
)
104 switch_call(ipio_init
)
105 switch_call(ipio_done
)
106 switch_call(ipret_init
)
107 switch_call(ipret_done
)
108 switch_call(task_init
)
109 switch_call(task_done
)
110 switch_call(task_run
)
111 switch_call(program_run
)