AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
September 2004

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2004.09.14 11:06 "Calltype support", by Martin Schramm
2004.09.15 13:46 "Re: Calltype support", by Frank Warmerdam
2004.09.15 15:02 "Re: Calltype support", by Bob Friesenhahn
2004.09.15 15:25 "Re: Calltype support", by Frank Warmerdam
2004.09.15 15:38 "Re: Calltype support", by Bob Friesenhahn
2004.09.16 17:54 "versioned symbols [Was: Calltype support]", by Jay Berkenbilt
2004.09.16 18:08 "Re: versioned symbols [Was: Calltype support]", by Thomas J Kacvinsky
2004.09.16 18:22 "Re: versioned symbols [Was: Calltype support]", by Jay Berkenbilt
2004.09.16 18:27 "Re: versioned symbols [Was: Calltype support]", by Thomas J Kacvinsky
2004.09.16 21:36 "Re: versioned symbols [Was: Calltype support]", by Andrey Kiselev
2004.09.16 22:36 "Re: versioned symbols [Was: Calltype support]", by Bob Friesenhahn
2004.09.19 15:52 "Re: versioned symbols [Was: Calltype support]", by Jay Berkenbilt
2004.09.19 19:34 "Re: versioned symbols [Was: Calltype support]", by Andrey Kiselev

2004.09.14 11:06 "Calltype support", by Martin Schramm

Hello,

we use the LibTiff in a WinNT environment and compile it with
calltype __cdecl.

To do this we added a file "tiff_decl.h" with code taken from
the JPEGlib routines:

   #ifndef _TIFFDECL_
   #define _TIFFDECL_

   // remove comments to get __cdecl calltype
   // #if defined(_Windows) || defined (_WIN32)
   // #define  _CALLTYPE_  __cdecl
   // #else
   #define  _CALLTYPE_
   // #endif

   #define  STATIC(type)  static type _CALLTYPE_
   #define  EXTERN(type)  extern type _CALLTYPE_
   #define  GLOBAL(type)         type _CALLTYPE_

   #endif  /* _TIFFDECL_ */

This file is includes in tiffio.h and fax3sm_winnt.c

Now in each file we change all function declarations
(use monospace font to view):


   BEFORE:                          AFTER:
   -----------------------          -------------------

   int                              GLOBAL(int)
   fname(...)                       fname(...)


   void                             GLOBAL(void)
   fname(...)                       fname(...)


   static int                       STATIC(int)
   fname(...)                       fname(...)


   extern int                       EXTERN(int)
   fname(...)                       fname(...)


   struct XYZ {                     struct XYZ {
     ...                              ...
     void (*fname)(...)               void (_CALLTYPE_ *fname)(...)
     ...                              ...
   }                                }


   typedef void (*fname)           typedef void (_CALLTYPE_ *fname)
           (...)                           (...)


This works perfectly, but has a great disadvantage: Migrating to a
new version of the LibTiff is painful because we have to do the same
work again.


Have you ever thought about adding calltype support, like the JPEGlib
does? I think the readability of the code does not decrease.
Or are there other (better?) ways to add calltype support?


Thanks for your help,
Martin Schramm