[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gm2] _M2_EXCEPTIONS_RAISE
From: |
Gaius Mulley |
Subject: |
Re: [Gm2] _M2_EXCEPTIONS_RAISE |
Date: |
Mon, 04 Jan 2010 20:47:00 +0000 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
Martin Kalbfuß <address@hidden> writes:
Hi Martin,
the procedures in gnuexcept2.cpp should be referenced by the
modulename (EXCEPTIONS) without the _M2_. The _M2_ is only used for
init/finish functions. So here is the code with modifications:
DEFINITION MODULE gnuexcept2 ;
PROCEDURE Action ;
END gnuexcept2.
typedef struct EXCEPTIONS_ExceptionSource
EXCEPTIONS_ExceptionSource;
extern "C" void EXCEPTIONS_AllocateSource(EXCEPTIONS_ExceptionSource *source);
extern "C" void EXCEPTIONS_RAISE(EXCEPTIONS_ExceptionSource
*source, unsigned int number, const char *message);
EXCEPTIONS_ExceptionSource *exSrc;
extern "C" void gnuexcept2_Action (void)
{
EXCEPTIONS_RAISE(exSrc, 1, "Hallo Welt");
}
extern "C" void _M2_gnuexcept2_init()
{
EXCEPTIONS_AllocateSource(exSrc);
}
extern "C" void _M2_gnuexcept2_finish()
{
}
MODULE test;
IMPORT gnuexcept2;
BEGIN
gnuexcept2.Action();
END test.
all: force
g++ -c gnuexcept2.cpp
gm2 -fiso -c test.mod
gm2 -fiso test.mod
clean: force
$(RM) *.o a.out *~
force:
regards,
Gaius