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 2008

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

2008.09.04 20:48 "Re: beta2 release - lfind() problem on Win64", by Edward Lam
2008.09.05 06:18 "Re: beta2 release - lfind() problem on Win64", by Andrey Kiselev
2008.09.05 13:09 "Re: beta2 release - lfind() problem on Win64", by Edward Lam

2008.09.04 20:48 "Re: beta2 release - lfind() problem on Win64", by Edward Lam

Hi Andrey,

I tried compiling libtiff to use lfind.c in the port/ directory. 
However, because the bad lfind() prototype still gets seen, the problem 
persists. ie. we get the following valid warning from VC8 on Win64:

tif_dirinfo.c(508) : warning C4133: 'function' : incompatible types - 
from 'size_t *' to 'unsigned int *'

So, I think that lfind() needs to be renamed to something like 
port_lfind() ?

Cheers,
-Edward

PS. Yes, I know this is an old issue but I haven't found time to get 
back to libtiff. :)

Andrey Kiselev wrote:
> On Mon, May 26, 2008 at 10:31:36AM -0500, Bob Friesenhahn wrote:
>> The recent libtiff updates in this area were necessary so that libtiff
>> works properly in 64-bit applications.  This is supposed to be the
>> prototype for lfind:
>>
>>      void *lfind(const void *key, const void *base, size_t *nelp,
>>      size_t width, int (*compar)(const void *, const void *));
>>
>> It seems that the only cure is to add Windows specific code to handle
>> this specific case.
> 
> We have such a code (see port/ directory) and it was used on Windows
> platform until I discovered that lfind is hidden under _lfind name
> there. So we can just continue using our implementation.
> 
> Other option is to use _lfind_s() function which is advertised as a
> "safe" replacement to the old one, but then we will need to modify
> comparison functions declarations too, because _lfind_s passes extra
> parameter down there. The first way is simpler, of course.
> 
> Best regards,
> Andrey
> 
> PS.
> OFF: do they seriously thinking that their "safe" functions really help
> people?
> 
>