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