Re: [fpc-pascal] Linking C object against "Pascal runtime"

2010-05-08 Thread Jonas Maebe
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

Re: [fpc-pascal] Linking C object against "Pascal runtime"

2010-05-08 Thread Jonas Maebe
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

Re: [fpc-pascal] Linking C object against "Pascal runtime"

2010-05-08 Thread Felipe Monteiro de Carvalho
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

[fpc-pascal] Linking C object against "Pascal runtime"

2010-05-08 Thread moichos
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