On 08 May 2010, at 23:09, Felipe Monteiro de Carvalho wrote:
> FPC automatically does name mangling in your procedures, I guess your
> procedure really looks currently like:
>
> function _strlen(s: pansichar): integer; cdecl name 'MYUNIT$_STRLEN';
No, it does not. cdecl always results in C name
On 08 May 2010, at 21:37, moic...@gmx.de wrote:
> I have a C file which I want to link statically into my FreePascal
> application. The C code is mostly self-contained, except for a few simple
> calls to the C runtime, one of them being "_strlen".
>
> Now "_strlen" is a simple enough function
FPC automatically does name mangling in your procedures, I guess your
procedure really looks currently like:
function _strlen(s: pansichar): integer; cdecl name 'MYUNIT$_STRLEN';
Or even greater, with parameter type info and stuff. I would recommend
that you declare it as:
function _strlen(s: pa
Hi,
I have a C file which I want to link statically into my FreePascal application.
The C code is mostly self-contained, except for a few simple calls to the C
runtime, one of them being "_strlen".
Now "_strlen" is a simple enough function to rewrite it in Pascal, and so I
did. However, FreePa