]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/m2/pge-boot/GM2RTS.c
Update copyright years.
[thirdparty/gcc.git] / gcc / m2 / pge-boot / GM2RTS.c
1 /* do not edit automatically generated by mc from M2RTS. */
2 /* M2RTS.mod Implements the run time system facilities of Modula-2.
3
4 Copyright (C) 2001-2023 Free Software Foundation, Inc.
5 Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
6
7 This file is part of GNU Modula-2.
8
9 GNU Modula-2 is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
12 any later version.
13
14 GNU Modula-2 is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
18
19 Under Section 7 of GPL version 3, you are granted additional
20 permissions described in the GCC Runtime Library Exception, version
21 3.1, as published by the Free Software Foundation.
22
23 You should have received a copy of the GNU General Public License and
24 a copy of the GCC Runtime Library Exception along with this program;
25 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
26 <http://www.gnu.org/licenses/>. */
27
28 # if !defined (PROC_D)
29 # define PROC_D
30 typedef void (*PROC_t) (void);
31 typedef struct { PROC_t proc; } PROC;
32 # endif
33
34 # if !defined (TRUE)
35 # define TRUE (1==1)
36 # endif
37
38 # if !defined (FALSE)
39 # define FALSE (1==0)
40 # endif
41
42 #include <stddef.h>
43 #include <string.h>
44 #include <limits.h>
45 #include <stdlib.h>
46 # include "GStorage.h"
47 #include <unistd.h>
48 #if defined(__cplusplus)
49 # undef NULL
50 # define NULL 0
51 #endif
52 #define _M2RTS_H
53 #define _M2RTS_C
54
55 # include "Glibc.h"
56 # include "GNumberIO.h"
57 # include "GStrLib.h"
58 # include "GSYSTEM.h"
59 # include "GASCII.h"
60 # include "GStorage.h"
61 # include "GRTExceptions.h"
62 # include "GM2EXCEPTION.h"
63 # include "GM2Dependent.h"
64
65 typedef struct M2RTS_ArgCVEnvP_p M2RTS_ArgCVEnvP;
66
67 typedef struct M2RTS_ProcedureList_r M2RTS_ProcedureList;
68
69 typedef char *M2RTS_PtrToChar;
70
71 typedef struct M2RTS__T1_r M2RTS__T1;
72
73 typedef M2RTS__T1 *M2RTS_ProcedureChain;
74
75 typedef void (*M2RTS_ArgCVEnvP_t) (int, void *, void *);
76 struct M2RTS_ArgCVEnvP_p { M2RTS_ArgCVEnvP_t proc; };
77
78 struct M2RTS_ProcedureList_r {
79 M2RTS_ProcedureChain head;
80 M2RTS_ProcedureChain tail;
81 };
82
83 struct M2RTS__T1_r {
84 PROC p;
85 M2RTS_ProcedureChain prev;
86 M2RTS_ProcedureChain next;
87 };
88
89 static M2RTS_ProcedureList InitialProc;
90 static M2RTS_ProcedureList TerminateProc;
91 static int ExitValue;
92 static unsigned int isHalting;
93 static unsigned int CallExit;
94 static unsigned int Initialized;
95
96 /*
97 ConstructModules - resolve dependencies and then call each
98 module constructor in turn.
99 */
100
101 extern "C" void M2RTS_ConstructModules (void * applicationmodule, int argc, void * argv, void * envp);
102
103 /*
104 DeconstructModules - resolve dependencies and then call each
105 module constructor in turn.
106 */
107
108 extern "C" void M2RTS_DeconstructModules (void * applicationmodule, int argc, void * argv, void * envp);
109
110 /*
111 RegisterModule - adds module name to the list of outstanding
112 modules which need to have their dependencies
113 explored to determine initialization order.
114 */
115
116 extern "C" void M2RTS_RegisterModule (void * name, M2RTS_ArgCVEnvP init, M2RTS_ArgCVEnvP fini, PROC dependencies);
117
118 /*
119 RequestDependant - used to specify that modulename is dependant upon
120 module dependantmodule.
121 */
122
123 extern "C" void M2RTS_RequestDependant (void * modulename, void * dependantmodule);
124
125 /*
126 InstallTerminationProcedure - installs a procedure, p, which will
127 be called when the procedure
128 ExecuteTerminationProcedures
129 is invoked. It returns TRUE if the
130 procedure is installed.
131 */
132
133 extern "C" unsigned int M2RTS_InstallTerminationProcedure (PROC p);
134
135 /*
136 ExecuteInitialProcedures - executes the initial procedures installed by
137 InstallInitialProcedure.
138 */
139
140 extern "C" void M2RTS_ExecuteInitialProcedures (void);
141
142 /*
143 InstallInitialProcedure - installs a procedure to be executed just
144 before the BEGIN code section of the
145 main program module.
146 */
147
148 extern "C" unsigned int M2RTS_InstallInitialProcedure (PROC p);
149
150 /*
151 ExecuteTerminationProcedures - calls each installed termination procedure
152 in reverse order.
153 */
154
155 extern "C" void M2RTS_ExecuteTerminationProcedures (void);
156
157 /*
158 Terminate - provides compatibility for pim. It calls exit with
159 the exitcode provided in a prior call to ExitOnHalt
160 (or zero if ExitOnHalt was never called). It does
161 not call ExecuteTerminationProcedures.
162 */
163
164 extern "C" void M2RTS_Terminate (void) __attribute__ ((noreturn));
165
166 /*
167 HALT - terminate the current program. The procedure
168 ExecuteTerminationProcedures
169 is called before the program is stopped. The parameter
170 exitcode is optional. If the parameter is not supplied
171 HALT will call libc 'abort', otherwise it will exit with
172 the code supplied. Supplying a parameter to HALT has the
173 same effect as calling ExitOnHalt with the same code and
174 then calling HALT with no parameter.
175 */
176
177 extern "C" void M2RTS_HALT (int exitcode) __attribute__ ((noreturn));
178
179 /*
180 Halt - provides a more user friendly version of HALT, which takes
181 four parameters to aid debugging.
182 */
183
184 extern "C" void M2RTS_Halt (const char *file_, unsigned int _file_high, unsigned int line, const char *function_, unsigned int _function_high, const char *description_, unsigned int _description_high) __attribute__ ((noreturn));
185
186 /*
187 ExitOnHalt - if HALT is executed then call exit with the exit code, e.
188 */
189
190 extern "C" void M2RTS_ExitOnHalt (int e);
191
192 /*
193 ErrorMessage - emits an error message to stderr and then calls exit (1).
194 */
195
196 extern "C" void M2RTS_ErrorMessage (const char *message_, unsigned int _message_high, const char *file_, unsigned int _file_high, unsigned int line, const char *function_, unsigned int _function_high) __attribute__ ((noreturn));
197
198 /*
199 Length - returns the length of a string, a. This is called whenever
200 the user calls LENGTH and the parameter cannot be calculated
201 at compile time.
202 */
203
204 extern "C" unsigned int M2RTS_Length (const char *a_, unsigned int _a_high);
205 extern "C" void M2RTS_AssignmentException (void * filename, unsigned int line, unsigned int column, void * scope, void * message);
206 extern "C" void M2RTS_ReturnException (void * filename, unsigned int line, unsigned int column, void * scope, void * message);
207 extern "C" void M2RTS_IncException (void * filename, unsigned int line, unsigned int column, void * scope, void * message);
208 extern "C" void M2RTS_DecException (void * filename, unsigned int line, unsigned int column, void * scope, void * message);
209 extern "C" void M2RTS_InclException (void * filename, unsigned int line, unsigned int column, void * scope, void * message);
210 extern "C" void M2RTS_ExclException (void * filename, unsigned int line, unsigned int column, void * scope, void * message);
211 extern "C" void M2RTS_ShiftException (void * filename, unsigned int line, unsigned int column, void * scope, void * message);
212 extern "C" void M2RTS_RotateException (void * filename, unsigned int line, unsigned int column, void * scope, void * message);
213 extern "C" void M2RTS_StaticArraySubscriptException (void * filename, unsigned int line, unsigned int column, void * scope, void * message);
214 extern "C" void M2RTS_DynamicArraySubscriptException (void * filename, unsigned int line, unsigned int column, void * scope, void * message);
215 extern "C" void M2RTS_ForLoopBeginException (void * filename, unsigned int line, unsigned int column, void * scope, void * message);
216 extern "C" void M2RTS_ForLoopToException (void * filename, unsigned int line, unsigned int column, void * scope, void * message);
217 extern "C" void M2RTS_ForLoopEndException (void * filename, unsigned int line, unsigned int column, void * scope, void * message);
218 extern "C" void M2RTS_PointerNilException (void * filename, unsigned int line, unsigned int column, void * scope, void * message);
219 extern "C" void M2RTS_NoReturnException (void * filename, unsigned int line, unsigned int column, void * scope, void * message);
220 extern "C" void M2RTS_CaseException (void * filename, unsigned int line, unsigned int column, void * scope, void * message);
221 extern "C" void M2RTS_WholeNonPosDivException (void * filename, unsigned int line, unsigned int column, void * scope, void * message);
222 extern "C" void M2RTS_WholeNonPosModException (void * filename, unsigned int line, unsigned int column, void * scope, void * message);
223 extern "C" void M2RTS_WholeZeroDivException (void * filename, unsigned int line, unsigned int column, void * scope, void * message);
224 extern "C" void M2RTS_WholeZeroRemException (void * filename, unsigned int line, unsigned int column, void * scope, void * message);
225 extern "C" void M2RTS_WholeValueException (void * filename, unsigned int line, unsigned int column, void * scope, void * message);
226 extern "C" void M2RTS_RealValueException (void * filename, unsigned int line, unsigned int column, void * scope, void * message);
227 extern "C" void M2RTS_ParameterException (void * filename, unsigned int line, unsigned int column, void * scope, void * message);
228 extern "C" void M2RTS_NoException (void * filename, unsigned int line, unsigned int column, void * scope, void * message);
229
230 /*
231 ExecuteReverse - execute the procedure associated with procptr
232 and then proceed to try and execute all previous
233 procedures in the chain.
234 */
235
236 static void ExecuteReverse (M2RTS_ProcedureChain procptr);
237
238 /*
239 AppendProc - append proc to the end of the procedure list
240 defined by proclist.
241 */
242
243 static unsigned int AppendProc (M2RTS_ProcedureList *proclist, PROC proc);
244
245 /*
246 ErrorString - writes a string to stderr.
247 */
248
249 static void ErrorString (const char *a_, unsigned int _a_high);
250
251 /*
252 InitProcList - initialize the head and tail pointers to NIL.
253 */
254
255 static void InitProcList (M2RTS_ProcedureList *p);
256
257 /*
258 Init - initialize the initial, terminate procedure lists and booleans.
259 */
260
261 static void Init (void);
262
263 /*
264 CheckInitialized - checks to see if this module has been initialized
265 and if it has not it calls Init. We need this
266 approach as this module is called by module ctors
267 before we reach main.
268 */
269
270 static void CheckInitialized (void);
271
272
273 /*
274 ExecuteReverse - execute the procedure associated with procptr
275 and then proceed to try and execute all previous
276 procedures in the chain.
277 */
278
279 static void ExecuteReverse (M2RTS_ProcedureChain procptr)
280 {
281 while (procptr != NULL)
282 {
283 (*procptr->p.proc) (); /* Invoke the procedure. */
284 procptr = procptr->prev; /* Invoke the procedure. */
285 }
286 }
287
288
289 /*
290 AppendProc - append proc to the end of the procedure list
291 defined by proclist.
292 */
293
294 static unsigned int AppendProc (M2RTS_ProcedureList *proclist, PROC proc)
295 {
296 M2RTS_ProcedureChain pdes;
297
298 Storage_ALLOCATE ((void **) &pdes, sizeof (M2RTS__T1));
299 pdes->p = proc;
300 pdes->prev = (*proclist).tail;
301 pdes->next = NULL;
302 if ((*proclist).head == NULL)
303 {
304 (*proclist).head = pdes;
305 }
306 (*proclist).tail = pdes;
307 return TRUE;
308 /* static analysis guarentees a RETURN statement will be used before here. */
309 __builtin_unreachable ();
310 }
311
312
313 /*
314 ErrorString - writes a string to stderr.
315 */
316
317 static void ErrorString (const char *a_, unsigned int _a_high)
318 {
319 int n;
320 char a[_a_high+1];
321
322 /* make a local copy of each unbounded array. */
323 memcpy (a, a_, _a_high+1);
324
325 n = static_cast<int> (libc_write (2, &a, static_cast<size_t> (StrLib_StrLen ((const char *) a, _a_high))));
326 }
327
328
329 /*
330 InitProcList - initialize the head and tail pointers to NIL.
331 */
332
333 static void InitProcList (M2RTS_ProcedureList *p)
334 {
335 (*p).head = NULL;
336 (*p).tail = NULL;
337 }
338
339
340 /*
341 Init - initialize the initial, terminate procedure lists and booleans.
342 */
343
344 static void Init (void)
345 {
346 InitProcList (&InitialProc);
347 InitProcList (&TerminateProc);
348 ExitValue = 0;
349 isHalting = FALSE;
350 CallExit = FALSE; /* default by calling abort */
351 }
352
353
354 /*
355 CheckInitialized - checks to see if this module has been initialized
356 and if it has not it calls Init. We need this
357 approach as this module is called by module ctors
358 before we reach main.
359 */
360
361 static void CheckInitialized (void)
362 {
363 if (! Initialized)
364 {
365 Initialized = TRUE;
366 Init ();
367 }
368 }
369
370
371 /*
372 ConstructModules - resolve dependencies and then call each
373 module constructor in turn.
374 */
375
376 extern "C" void M2RTS_ConstructModules (void * applicationmodule, int argc, void * argv, void * envp)
377 {
378 M2Dependent_ConstructModules (applicationmodule, argc, argv, envp);
379 }
380
381
382 /*
383 DeconstructModules - resolve dependencies and then call each
384 module constructor in turn.
385 */
386
387 extern "C" void M2RTS_DeconstructModules (void * applicationmodule, int argc, void * argv, void * envp)
388 {
389 M2Dependent_DeconstructModules (applicationmodule, argc, argv, envp);
390 }
391
392
393 /*
394 RegisterModule - adds module name to the list of outstanding
395 modules which need to have their dependencies
396 explored to determine initialization order.
397 */
398
399 extern "C" void M2RTS_RegisterModule (void * name, M2RTS_ArgCVEnvP init, M2RTS_ArgCVEnvP fini, PROC dependencies)
400 {
401 M2Dependent_RegisterModule (name, (M2Dependent_ArgCVEnvP) {(M2Dependent_ArgCVEnvP_t) init.proc}, (M2Dependent_ArgCVEnvP) {(M2Dependent_ArgCVEnvP_t) fini.proc}, dependencies);
402 }
403
404
405 /*
406 RequestDependant - used to specify that modulename is dependant upon
407 module dependantmodule.
408 */
409
410 extern "C" void M2RTS_RequestDependant (void * modulename, void * dependantmodule)
411 {
412 M2Dependent_RequestDependant (modulename, dependantmodule);
413 }
414
415
416 /*
417 InstallTerminationProcedure - installs a procedure, p, which will
418 be called when the procedure
419 ExecuteTerminationProcedures
420 is invoked. It returns TRUE if the
421 procedure is installed.
422 */
423
424 extern "C" unsigned int M2RTS_InstallTerminationProcedure (PROC p)
425 {
426 return AppendProc (&TerminateProc, p);
427 /* static analysis guarentees a RETURN statement will be used before here. */
428 __builtin_unreachable ();
429 }
430
431
432 /*
433 ExecuteInitialProcedures - executes the initial procedures installed by
434 InstallInitialProcedure.
435 */
436
437 extern "C" void M2RTS_ExecuteInitialProcedures (void)
438 {
439 ExecuteReverse (InitialProc.tail);
440 }
441
442
443 /*
444 InstallInitialProcedure - installs a procedure to be executed just
445 before the BEGIN code section of the
446 main program module.
447 */
448
449 extern "C" unsigned int M2RTS_InstallInitialProcedure (PROC p)
450 {
451 return AppendProc (&InitialProc, p);
452 /* static analysis guarentees a RETURN statement will be used before here. */
453 __builtin_unreachable ();
454 }
455
456
457 /*
458 ExecuteTerminationProcedures - calls each installed termination procedure
459 in reverse order.
460 */
461
462 extern "C" void M2RTS_ExecuteTerminationProcedures (void)
463 {
464 ExecuteReverse (TerminateProc.tail);
465 }
466
467
468 /*
469 Terminate - provides compatibility for pim. It calls exit with
470 the exitcode provided in a prior call to ExitOnHalt
471 (or zero if ExitOnHalt was never called). It does
472 not call ExecuteTerminationProcedures.
473 */
474
475 extern "C" void M2RTS_Terminate (void)
476 {
477 libc_exit (ExitValue);
478 }
479
480
481 /*
482 HALT - terminate the current program. The procedure
483 ExecuteTerminationProcedures
484 is called before the program is stopped. The parameter
485 exitcode is optional. If the parameter is not supplied
486 HALT will call libc 'abort', otherwise it will exit with
487 the code supplied. Supplying a parameter to HALT has the
488 same effect as calling ExitOnHalt with the same code and
489 then calling HALT with no parameter.
490 */
491
492 extern "C" void M2RTS_HALT (int exitcode)
493 {
494 if (exitcode != -1)
495 {
496 CallExit = TRUE;
497 ExitValue = exitcode;
498 }
499 if (isHalting)
500 {
501 /* double HALT found */
502 libc_exit (-1);
503 }
504 else
505 {
506 isHalting = TRUE;
507 M2RTS_ExecuteTerminationProcedures ();
508 }
509 if (CallExit)
510 {
511 libc_exit (ExitValue);
512 }
513 else
514 {
515 libc_abort ();
516 }
517 }
518
519
520 /*
521 Halt - provides a more user friendly version of HALT, which takes
522 four parameters to aid debugging.
523 */
524
525 extern "C" void M2RTS_Halt (const char *file_, unsigned int _file_high, unsigned int line, const char *function_, unsigned int _function_high, const char *description_, unsigned int _description_high)
526 {
527 char file[_file_high+1];
528 char function[_function_high+1];
529 char description[_description_high+1];
530
531 /* make a local copy of each unbounded array. */
532 memcpy (file, file_, _file_high+1);
533 memcpy (function, function_, _function_high+1);
534 memcpy (description, description_, _description_high+1);
535
536 M2RTS_ErrorMessage ((const char *) description, _description_high, (const char *) file, _file_high, line, (const char *) function, _function_high);
537 M2RTS_HALT (-1);
538 __builtin_unreachable ();
539 }
540
541
542 /*
543 ExitOnHalt - if HALT is executed then call exit with the exit code, e.
544 */
545
546 extern "C" void M2RTS_ExitOnHalt (int e)
547 {
548 ExitValue = e;
549 CallExit = TRUE;
550 }
551
552
553 /*
554 ErrorMessage - emits an error message to stderr and then calls exit (1).
555 */
556
557 extern "C" void M2RTS_ErrorMessage (const char *message_, unsigned int _message_high, const char *file_, unsigned int _file_high, unsigned int line, const char *function_, unsigned int _function_high)
558 {
559 typedef struct ErrorMessage__T2_a ErrorMessage__T2;
560
561 struct ErrorMessage__T2_a { char array[10+1]; };
562 ErrorMessage__T2 LineNo;
563 char message[_message_high+1];
564 char file[_file_high+1];
565 char function[_function_high+1];
566
567 /* make a local copy of each unbounded array. */
568 memcpy (message, message_, _message_high+1);
569 memcpy (file, file_, _file_high+1);
570 memcpy (function, function_, _function_high+1);
571
572 ErrorString ((const char *) file, _file_high);
573 ErrorString ((const char *) ":", 1);
574 NumberIO_CardToStr (line, 0, (char *) &LineNo.array[0], 10);
575 ErrorString ((const char *) &LineNo.array[0], 10);
576 ErrorString ((const char *) ":", 1);
577 if (! (StrLib_StrEqual ((const char *) function, _function_high, (const char *) "", 0)))
578 {
579 ErrorString ((const char *) "in ", 3);
580 ErrorString ((const char *) function, _function_high);
581 ErrorString ((const char *) " has caused ", 12);
582 }
583 ErrorString ((const char *) message, _message_high);
584 LineNo.array[0] = ASCII_nl;
585 LineNo.array[1] = ASCII_nul;
586 ErrorString ((const char *) &LineNo.array[0], 10);
587 libc_exit (1);
588 }
589
590
591 /*
592 Length - returns the length of a string, a. This is called whenever
593 the user calls LENGTH and the parameter cannot be calculated
594 at compile time.
595 */
596
597 extern "C" unsigned int M2RTS_Length (const char *a_, unsigned int _a_high)
598 {
599 unsigned int l;
600 unsigned int h;
601 char a[_a_high+1];
602
603 /* make a local copy of each unbounded array. */
604 memcpy (a, a_, _a_high+1);
605
606 l = 0;
607 h = _a_high;
608 while ((l <= h) && (a[l] != ASCII_nul))
609 {
610 l += 1;
611 }
612 return l;
613 /* static analysis guarentees a RETURN statement will be used before here. */
614 __builtin_unreachable ();
615 }
616
617 extern "C" void M2RTS_AssignmentException (void * filename, unsigned int line, unsigned int column, void * scope, void * message)
618 {
619 /*
620 The following are the runtime exception handler routines.
621 */
622 RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), filename, line, column, scope, message);
623 }
624
625 extern "C" void M2RTS_ReturnException (void * filename, unsigned int line, unsigned int column, void * scope, void * message)
626 {
627 RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), filename, line, column, scope, message);
628 }
629
630 extern "C" void M2RTS_IncException (void * filename, unsigned int line, unsigned int column, void * scope, void * message)
631 {
632 RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), filename, line, column, scope, message);
633 }
634
635 extern "C" void M2RTS_DecException (void * filename, unsigned int line, unsigned int column, void * scope, void * message)
636 {
637 RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), filename, line, column, scope, message);
638 }
639
640 extern "C" void M2RTS_InclException (void * filename, unsigned int line, unsigned int column, void * scope, void * message)
641 {
642 RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), filename, line, column, scope, message);
643 }
644
645 extern "C" void M2RTS_ExclException (void * filename, unsigned int line, unsigned int column, void * scope, void * message)
646 {
647 RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), filename, line, column, scope, message);
648 }
649
650 extern "C" void M2RTS_ShiftException (void * filename, unsigned int line, unsigned int column, void * scope, void * message)
651 {
652 RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), filename, line, column, scope, message);
653 }
654
655 extern "C" void M2RTS_RotateException (void * filename, unsigned int line, unsigned int column, void * scope, void * message)
656 {
657 RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), filename, line, column, scope, message);
658 }
659
660 extern "C" void M2RTS_StaticArraySubscriptException (void * filename, unsigned int line, unsigned int column, void * scope, void * message)
661 {
662 RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_indexException)), filename, line, column, scope, message);
663 }
664
665 extern "C" void M2RTS_DynamicArraySubscriptException (void * filename, unsigned int line, unsigned int column, void * scope, void * message)
666 {
667 RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_indexException)), filename, line, column, scope, message);
668 }
669
670 extern "C" void M2RTS_ForLoopBeginException (void * filename, unsigned int line, unsigned int column, void * scope, void * message)
671 {
672 RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), filename, line, column, scope, message);
673 }
674
675 extern "C" void M2RTS_ForLoopToException (void * filename, unsigned int line, unsigned int column, void * scope, void * message)
676 {
677 RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), filename, line, column, scope, message);
678 }
679
680 extern "C" void M2RTS_ForLoopEndException (void * filename, unsigned int line, unsigned int column, void * scope, void * message)
681 {
682 RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), filename, line, column, scope, message);
683 }
684
685 extern "C" void M2RTS_PointerNilException (void * filename, unsigned int line, unsigned int column, void * scope, void * message)
686 {
687 RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_invalidLocation)), filename, line, column, scope, message);
688 }
689
690 extern "C" void M2RTS_NoReturnException (void * filename, unsigned int line, unsigned int column, void * scope, void * message)
691 {
692 RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_functionException)), filename, line, column, scope, message);
693 }
694
695 extern "C" void M2RTS_CaseException (void * filename, unsigned int line, unsigned int column, void * scope, void * message)
696 {
697 RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_caseSelectException)), filename, line, column, scope, message);
698 }
699
700 extern "C" void M2RTS_WholeNonPosDivException (void * filename, unsigned int line, unsigned int column, void * scope, void * message)
701 {
702 RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeDivException)), filename, line, column, scope, message);
703 }
704
705 extern "C" void M2RTS_WholeNonPosModException (void * filename, unsigned int line, unsigned int column, void * scope, void * message)
706 {
707 RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeDivException)), filename, line, column, scope, message);
708 }
709
710 extern "C" void M2RTS_WholeZeroDivException (void * filename, unsigned int line, unsigned int column, void * scope, void * message)
711 {
712 RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeDivException)), filename, line, column, scope, message);
713 }
714
715 extern "C" void M2RTS_WholeZeroRemException (void * filename, unsigned int line, unsigned int column, void * scope, void * message)
716 {
717 RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeDivException)), filename, line, column, scope, message);
718 }
719
720 extern "C" void M2RTS_WholeValueException (void * filename, unsigned int line, unsigned int column, void * scope, void * message)
721 {
722 RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeValueException)), filename, line, column, scope, message);
723 }
724
725 extern "C" void M2RTS_RealValueException (void * filename, unsigned int line, unsigned int column, void * scope, void * message)
726 {
727 RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realValueException)), filename, line, column, scope, message);
728 }
729
730 extern "C" void M2RTS_ParameterException (void * filename, unsigned int line, unsigned int column, void * scope, void * message)
731 {
732 RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), filename, line, column, scope, message);
733 }
734
735 extern "C" void M2RTS_NoException (void * filename, unsigned int line, unsigned int column, void * scope, void * message)
736 {
737 RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), filename, line, column, scope, message);
738 }
739
740 extern "C" void _M2_M2RTS_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[])
741 {
742 CheckInitialized ();
743 }
744
745 extern "C" void _M2_M2RTS_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[])
746 {
747 }