Danny Smith writes:
>Unless you are planning to use a gfortran dll in a VisualBasic app, I
>can see little reason to change from the default "C" calling convention

FX Coudert writes:
>That precise reason is, as far as I understand, important for some
>people. Fortran code is used for internal routines, built into shared
>libraries that are later plugged into commercial apps.

Well, perhaps things are different in Fortran, but the big problem with
using -mrtd in C/C++ is that it changes the default calling convention for
all functions, not just those that are ment to be exported.  While most of
MinGW's of headers declare the calling convention of functions explictily,
not all of them do.

>How hard do you think it would be to implement a -mrtd-naming option
>(or another name) to go with -mrtd and add name decorations

It wouldn't be too hard, but I don't think it would be a good idea to
implement.  It would mislead people into thinking the option might be
useful, and -mrtd fools enough people as it is.  Adding name decorations
won't make it more useful.  From the examples I've seen, VisualBasic 6
has no problem DLL functions expored without "@n" suffixes.

Any library that needs to be able to be called from VisualBasic 6 or some
other "stdcall only" environment should explictly declare it's exported
functions with the stdcall calling convention.

                                        Ross Ridge

Reply via email to