gcc/libgm2/libm2iso/m2rts.h
Gaius Mulley 77924dff14 PR 107630 runtime libs should be self-contained
This is a patch to improve the layering of libgm2.
It removes the m2cor Debug.{def,mod} (the codebase will use
m2pim Debug instead).  It also layers SysStorage under
both m2pim Storage and m2iso Storage.  SysStorage is now
a dependant of m2pim Storage.mod.  Halt parameters for
Debug.mod and M2RTS.mod now have the same order.

gcc/m2/ChangeLog:

	* gm2-compiler/SymbolKey.mod (PutSymKey): Halt parameters
	reordered.
	(DelSymKey): Ditto.
	* gm2-compiler/ppg.mod (GetEpsilon): Ditto.
	(GetReachEnd): Ditto.
	(GetFollow): Ditto.
	(CodeCondition): Ditto.
	(CodeThenDo): Ditto.
	(CodeEnd): Ditto.
	(RecoverCondition): Ditto.
	(ConditionIndent): Ditto.
	* gm2-libs-ch/m2rts.h (M2RTS_Halt): Ditto.
	* gm2-libs-coroutines/Executive.mod (Assert): Ditto.
	(Resume): Remove redundant comments.
	(Wait): Remove redundant comments.
	* gm2-libs-coroutines/SYSTEM.mod (TRANSFER): Halt parameters
	reordered.
	(IOTransferHandler): Ditto.
	(Finished): Ditto.
	(localInit): Ditto.
	* gm2-libs-coroutines/TimerHandler.mod (WaitOn): Halt parameters
	reordered.
	(Cancel): Ditto.
	(ReArmEvent): Ditto.
	(OnActiveQueue): Ditto.
	* gm2-libs-iso/COROUTINES.mod (NEWCOROUTINE): Ditto.
	(Transfer): Ditto.
	(IOTRANSFER): Ditto.
	* gm2-libs-iso/EXCEPTIONS.mod (RAISE): Correct Halt parameters.
	* gm2-libs-iso/M2RTS.def (Halt): Halt parameters reordered.
	(HaltC): Ditto.
	* gm2-libs-iso/M2RTS.mod: Ditto.
	* gm2-libs-iso/RTentity.mod (PutKey): Ditto.
	(DelKey): Ditto.
	(findChildAndParent): Ditto.
	(assert): Ditto.
	* gm2-libs-iso/Storage.mod (ALLOCATE): Add DebugTrace.
	Add UseMallocFree test.
	(DEALLOCATE): Add DebugTrace.  Add UseMallocFree test.
	(assert): Halt parameters reordered.
	* gm2-libs-log/Termbase.mod (Read): Ditto.
	(KeyPressed): Ditto.
	(Write): Ditto.
	(Init): Ditto.
	* gm2-libs/Debug.def (Halt): Halt parameters reordered.
	* gm2-libs/Debug.mod (Halt): Ditto.
	* gm2-libs/DynamicStrings.def (PopAllocation): Improve comment.
	* gm2-libs/DynamicStrings.mod (PopAllocation): Improve comment.
	Halt parameters reordered.
	* gm2-libs/M2RTS.def (Halt): Ditto.
	(HaltC): Ditto.
	* gm2-libs/M2RTS.mod (Halt): Ditto.
	(HaltC): Ditto.
	* gm2-libs/PushBackInput.mod (PutStr): Ditto.
	(PutString): Ditto.
	(PutCh): Ditto.
	* gm2-libs/RTExceptions.mod (GetBaseExceptionBlock): Ditto.
	* gm2-libs/RTint.mod (ReArmTimeVector): Ditto.
	(GetTimeVector): Ditto.
	(AttachVector): Ditto.
	(IncludeVector): Ditto.
	(Listen): Ditto.
	* gm2-libs/SysStorage.mod (ALLOCATE): Ditto.
	(DEALLOCATE): Ditto.
	(REALLOCATE): Ditto.
	* gm2-libs-coroutines/Debug.def: Removed.
	* gm2-libs-coroutines/Debug.mod: Removed.

libgm2/ChangeLog:

	* libm2cor/Makefile.am: Remove
	* libm2cor/Makefile.in: Rebuild.
	* libm2iso/RTco.cc (newSem): Halt parameters reordered.
	(currentThread): Ditto.
	(never): Ditto.
	(defined): Ditto.
	(initThread): Ditto.
	* libm2iso/m2rts.h (m2iso_M2RTS_HaltC): Ditto.

gcc/testsuite/ChangeLog:

	* gm2/complex/pass/arith3.mod: Halt parameters reordered.
	* gm2/complex/run/pass/arith3.mod: Ditto.
	* gm2/complex/run/pass/arith4.mod: Ditto.
	* gm2/complex/run/pass/arith5.mod: Ditto.
	* gm2/isolib/run/pass/real2.mod: Ditto.
	* gm2/isolib/run/pass/real3.mod: Ditto.
	* gm2/isolib/run/pass/realconv.mod: Ditto.
	* gm2/isolib/run/pass/realconv2.mod: Ditto.
	* gm2/pim/pass/testshort.mod: Ditto.
	* gm2/projects/pim/run/pass/tower/AdvSystem.mod: Ditto.
	* gm2/projects/pim/run/pass/tower/DrawL.mod: Ditto.
	* gm2/warnings/returntype/pass/Termbase.mod: Ditto.
	* gm2/warnings/returntype/pass/keypressedsimple.mod: Ditto.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-03-16 20:34:32 +00:00

49 lines
2.1 KiB
C

/* m2rts.h provides a C interface to M2RTS.mod.
Copyright (C) 2019-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
Under Section 7 of GPL version 3, you are granted additional
permissions described in the GCC Runtime Library Exception, version
3.1, as published by the Free Software Foundation.
You should have received a copy of the GNU General Public License and
a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
#define str(X) #X
typedef void (*proc_con) (int, char **, char **);
typedef void (*proc_dep) (void);
extern "C" void m2iso_M2RTS_RequestDependant (const char *modulename, const char *libname, const char *dependancy);
extern "C" void m2iso_M2RTS_RegisterModule (const char *modulename, const char *libname,
proc_con init, proc_con fini, proc_dep dependencies);
extern "C" void m2pim_M2RTS_RegisterModule (const char *modulename, const char *libname,
proc_con init, proc_con fini, proc_dep dependencies);
extern "C" void M2RTS_RegisterModule (const char *modulename, const char *libname,
proc_con init, proc_con fini, proc_dep dependencies);
extern "C" void m2iso_M2_M2RTS_init (void);
extern "C" void m2iso_M2RTS_ConstructModules (const char *modulename, const char *libname,
int argc, char *argv[], char *envp[]);
extern "C" void m2iso_M2RTS_Terminate (void);
extern "C" void m2iso_M2RTS_DeconstructModules (void);
extern "C" void m2iso_M2RTS_HaltC (const char *desc, const char *filename,
const char *functionname, int line) __attribute__ ((noreturn));