I recently noticed a difference in the function _findfirst()
From msdn we have:
VC6:
long _findfirst( char *filespec, struct _finddata_t *fileinfo );
VC2005:
intptr_t _findfirst(
const char *filespec,
struct _finddata_t *fileinfo
);
Since I need to build code to support multiple versions of VC++ I need some way to distinguish which version to use. Otherwise I end up getting type problems which results in either warnings or errors.
Should I filter for compiler version in preprocessing or is there another method
Thanks in advance.
Henrik Goldman
X-Formation (http://www.x-formation.com)

_findfirst() prototype changes
joop
Of course we do not have a shipping version of 6.0 that targets 64 bit versions of Windows, so your fix is "safe" in that way.
Ronald
BrunoCO
Thanks,
Jantje.
Cillian
The problem is that VC6 doesn't understand intptr_t.
So In order to get it working I had to do the following which seems to work fine:
#if _MSC_VER == 1200 /* VC++ 6.0 doesn't understand intptr_t */
typedef
long intptr_t;#endif
...
intptr_t pFile;
...
if
((pFile = _findfirst(szFullPath, &FindData)) != -1)...
Will Buchanan
Why would you get type problems Any call site that satisfies the current declaration would also work with the 6.0 version of the declaration. We did quite a bit of work on cost correctness after 6.0 shipped.
Ronald Laeremans
Visual C++ team