OK, got it. I had to settle for _stat64() instead of _stati64() because the crt64.lib that comes with version 10.00.6 only has _stat64().
Here's the function that wouldn't compile:
int getsize(char *infile, char *keyfile)
{
struct __stat64 inbuf, keybuf;
int rn, rk;
rn =_stat64( infile, &inbuf );
rk =_stat64( keyfile, &keybuf );
if(rn!=0 || rk!=0){
printf("stat64 error...\n");
return -1;
}
if(inbuf.st_size < keybuf.st_size)
printf("infile is smaller than keyfile - OK\n");
else
printf("infile is greater than keyfile - NOT OK!\n");
return 0;
}
What I did:
in sys/stat.h, I added these defs:
#ifndef _STAT64_DEFINED
#define _STAT64_DEFINED
struct __stat64
{
_dev_t st_dev;
_ino_t st_ino;
unsigned short st_mode;
short st_nlink;
short st_uid;
short st_gid;
_dev_t st_rdev;
__int64 st_size;
time_t st_atime;
time_t st_mtime;
time_t st_ctime;
};
#endif
extern _CRTIMP int __cdecl _stat64(const char *, struct __stat64 *);
That handled the declarations. To handle the lib, I added crt64.lib to the linker.
At least on my test files, it worked. I needed the ability to check for file sizes possibly greater than 4GB, so had to have a 64-bit version of _stat(), which the default headers don't provide.
Thanks for looking.