[gdal-dev] GDAL 1.8 - Switch Thrown

Frank Warmerdam warmerdam at pobox.com
Sat Jan 29 11:52:07 EST 2011


On 11-01-29 09:52 AM, Ari Jolma wrote:
> Did anybody else try to use the now standard Visual Studio built GDAL DLL
> (which was much discussed some time ago here and is now available from Tamas'
> site) in a MinGW environment?
>
> I spent some time a week or two ago on the issue, but I had a hard time, which
> AFAIK is because the DLL mixes two function export methods and thus using the
> standard tools seems difficult if not impossible (I already downloaded the
> sources for latest GNU dlltool and considered hacking it...)
>
> The best page about the issue I found so far is this:
> http://wyw.dcweb.cn/stdcall.htm
>
> Anybody have any ideas? Is my observation about the two export methods correct
> and why is that?

Ari,

It is true that some GDAL/OGR entry points are using cdecl, and some
are using stdcall.  Some were converted to stdcall several years ago
to facilitate calls into the DLL from VB6 and Delphi Pascal which
apparently could not easily call cdecl functions.

I believe these entry points can be used from gcc but you need to be sure
the stdcall decorations are properly applied when the include files are
processed.  There is some stuff about this in cpl_port.h, and I think you
can predefine CPL_STDCALL for alternate environments.

I think I did note this as one item we would likely want to discard
from the ABI in GDAL 2.0.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list