[fpc-devel]crash
Maxim Artemev
bert_raccoon at freemail.ru
Tue Aug 6 08:40:10 CEST 2002
----- Original Message -----
From: Michael Van Canneyt <michael.vancanneyt at wisa.be>
To: <fpc-devel at deadlock.et.tudelft.nl>
Sent: Tuesday, August 06, 2002 11:21 AM
Subject: Re: [fpc-devel]crash
>
>
> On Mon, 5 Aug 2002, Maxim Artemev wrote:
>
> > Hello.
> >
> > >From the manual:
> > [--cut--]
> > 'If the procedure is declared with the cdecl modifier, then the compiler
> > will pass the array as a C compiler would pass it. This, in effect,
emulates
> > the C construct of a varable number of arguments, as the following
example
> > will show:'
> > [--cut--]
> >
> > This works only under *NIX (I was tested under FreeBSD)
> >
> > Under Win32 when I'm trying to call a declared function in DLL with
> > C-variable array parameters it makes a crash with run-time error 217
> > (perhaps stack overflow?).
> > Any solve of this problem?
>
> Functions in Windows DLLs usually use the stdcall calling convention.
> Are you sure that cdecl is the correct covention for the library
> you are trying to use ?
>
Yes. I'm translating C headers of Tcl library. None of __stdcall or PASCAL
or WINAPI wasn't declared.
extern __attribute__(( dllimport )) void Tcl_AppendResult(Tcl_Interp *
interp , ...);
translated to:
procedure Tcl_AppendResult(interp: pTcl_Interp; args: array of const);
cdecl; external TCL_LIBRARY;
More information about the fpc-devel
mailing list