2003.05.21 21:24 "Win32 libtiff calling convention", by Khouri Giordano

2003.05.21 21:24 "Win32 libtiff calling convention", by Khouri Giordano

I'm new to the list so forgive me if this has come up before.

Problem definition:

This only applies to win32 builds of libtiff. I am working with version 3.6.0-beta.

Since the makefile.vc doesn't define any calling convention, cdecl is used as a default. I prefer stddecl and use it as the default when building my projects. When I link to libtiff, the linker can't match up any of the TIFFXxx functions because the library and the application where built using two different calling conventions.

Solution:

To tiffio.h I added a TIFFDECL define to explicitly use cdecl for win32 builds. I used TIFFDECL in every function pointer typedef and function prototype.

I would like to submit this to the libtiff project so everyone else can have it, but have no idea how to go about this.

Khouri Giordano
Software Technology Researcher
Nikon Electronic Imaging | http://www.nikonusa.com/
kgiordano@nikondev.com