[M3devel] declaring a type's existance but not enough to instantiate it?
Jay
jay.krell at cornell.edu
Sun Jan 11 15:44:14 CET 2009
Is there a way in Modula-3 to declare that a type exists, and there are <*external*> instances of it, without "fully" declaring it, so that no Modula-3 can instantiate it?
I have done this for sigset_t and sem_t, but they could erroneously be instantiated by Modula-3 and I'd like to remove that ability to mess up so easily.
(* This type is not declared correctly. It is only instantiated in C code. *) sigset_t = RECORD END;
(* This type is not declared correctly. It is only instantiated in C code. *) sem_t = RECORD END;
In C I believe you can do this, like:
typedef struct foo foo_t;
extern foo_t foo;
void UseFoo(foo_t*);
foo_t* GetFoo(void);
Thanks,
- Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20090111/df920a10/attachment-0001.html>
More information about the M3devel
mailing list