> The version of TIFF headers I have uses extern "C" if compiling under > C++, so I doubt the library is using Pascal calling conventions. > Maybe Juanma's library is different than mine.
Unless I'm wrong, the issue is not how the functions are defined on the headers, because we don't statically link against the functions, but how are they compiled in the library and how do we define the fn_XXX pointers to them. In this case, the GnuWin32 TIFF 3.7.2 libraries seem to be compiled to use C calling conventions, but we declare pointers to them with DEF_IMGLIB_FN, which says unequivocally that they're FARPROC (i.e, "pascal"). Defining typedef int (FAR CDECL *CFARPROC)(); #define DEF_IMGLIB_FNC(func) CFARPROC fn_##func and using DEF_IMGLIB_FNC for the Tiff functions works. The TIFF page in gnuwin32.sourceforge.net says: "The GnuWin32 distribution comes in two versions. The ordinary version uses the standard Unix equivalents, such as fopen and read, for input and output, the other version (Tiff-win32) uses the Win32 API functions, such as CreateFile and ReadFile, for input and output. The ordinary version (Tiff) is more suitable for porting Unix programs, the Win32-API version is more suitable for writing Win32 programs." However, I'm getting the same results (problems, I mean) with the standard and the Win32 versions. -- /L/e/k/t/u _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel