[ooc-compiler] Oberon string to C string
Brought to you by:
mva
|
From: August K. <fus...@co...> - 2005-09-21 16:32:49
|
Hi all,
How do I pass an Oberon string to a C function taking a (constant)
string parameter? The Oberon code generated by the C header converter
H2O seems to use `POINTER [CSTRING] TO ARRAY OF CHAR' for `char *',
however with the code below I get a warning from oo2c: "conflicting
types for built-in function `puts'".
MODULE Test;
IMPORT Interface;
BEGIN
Interface.puts("Hello there!")
END Test.
MODULE Interface [INTERFACE "C"];
TYPE String* = POINTER [CSTRING] TO ARRAY OF CHAR;
PROCEDURE puts*(s: String);
END Interface.
Regards,
August
|