|
From: | ED GROSSHEIM |
Subject: | [Tinycc-devel] Re: Vol 88 Hi Is there a winbase.h available for TinyCC that includes function ReplaceFile ? Timo |
Date: | Wed, 25 Aug 2010 15:22:23 -0700 (PDT) |
Well I am wondering if I need a header file update.
Running your code:
// // ~ • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •
#define _WIN32_WINNT 0x0500
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
WINBASEAPI WINBOOL WINAPI ReplaceFileA(
LPCSTR lpReplacedFileName,
LPCSTR lpReplacementFileName,
LPCSTR lpBackupFileName,
DWORD dwReplaceFlags,
LPVOID lpExclude,
LPVOID lpReserved);
LPCSTR lpReplacedFileName = "file0.txt";
LPCSTR lpReplacementFileName = "file1.txt";
LPCSTR lpBackupFileName = "file2.txt";
void test(void) {
BOOL test = ReplaceFile(
lpReplacedFileName,
lpReplacementFileName,
//lpBackupFileName,
NULL,
REPLACEFILE_WRITE_THROUGH | REPLACEFILE_IGNORE_MERGE_ERRORS,
NULL,
NULL
);
}
// // ~ • • • • • • • •
• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •
I am getting the same error I first got when I tried to compile my file with the ReplaceFile Call:
Timo Win32_Lean_and_Mean and ReplaceFile.c:26: 'REPLACEFILE_WRITE_THROUGH' undeclared.
After I first saw this, I did a search of all header files in TCC and found that "'REPLACEFILE_WRITE_THROUGH" is not in any TCC header file. Then I searched for ReplaceFile, and found it was not anywhere either.
Searching the Pelles header files I found everything in winbase.h.
TCC's winbase.h does not have the prototype or defines.
So I am wondering why the above file builds for you?
I am using "tcc-0.9.25"
One reason I had for asking (because the Remove(), and Rename() getaround does work) ..... was to see if I could put the prototype and defines in my main source file instead..... and getaround the missing info in winbase.h.
Am I doing something wrong?
Thanks, Ed
[Prev in Thread] | Current Thread | [Next in Thread] |