[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gm2] version of compile time library

From: Gaius Mulley
Subject: Re: [Gm2] version of compile time library
Date: Thu, 17 Dec 2009 01:50:14 +0000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Martin Kalbfuß <address@hidden> writes:

> Hi,
> SDL has two ways of getting the library version. A function which is
> returning the version of the linked library. And some defines in a
> header repesenting the compile time version. Modula-2 has definition
> modules. Not headers. So I'm not sure how to to something like this?
> I tried to include the defines in the definition module of the library.
> But the program importing the module doesn't see them.
> What about __INLINE__? Could this help here?
> Thanks,

Hi Martin,

2 ways to achieve this:

(i)  either the implementation module could
  #include <header.h>

   m2_major = CPP_VERSION_MAJOR ;
   m2_minor = CPP_VERSION_MINOR ;   (* etc *)

and set some record constructor which is initialised to these
values.  You need to compile the implementation module using -fcpp.

(ii)  or possibly write a C wrapper implementation module, write a
      M2 definition module for C and export the function which returns
      a C constructor.

there are probably other ways but these are the two I would consider first,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]