tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Hi Is there a winbase.h available for TinyCC that inc


From: grischka
Subject: Re: [Tinycc-devel] Hi Is there a winbase.h available for TinyCC that includes function ReplaceFile ?
Date: Wed, 25 Aug 2010 22:03:59 +0200
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

It appears that ReplaceFile is declared in tcc's winbase.h but
is not in lib/kernel32.def.

You might either regenerate kernel32.def on your system using
tiny_impdef.exe (see tcc-win32.txt for details) or simply append
one line like
   ReplaceFileA
to lib/kernel32.def

--- grischka

Timo Lähde wrote:
Hello Ed!

tcc.exe can compile this:
------------------------------------------------------------
#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
               );
}
------------------------------------------------------------
-- Timppa


2010/8/25 ED GROSSHEIM <address@hidden>:
8-04 am  08-25-10

    Hi,

  I would like to be able to build a source file that includes a call to the
function ReplaceFile(). It compiles in PellesC.

In the winbase.h for Pelles, I see:
#if (_WIN32_WINNT >= 0x0500)
#define REPLACEFILE_WRITE_THROUGH  0x00000001
#define REPLACEFILE_IGNORE_MERGE_ERRORS  0x00000002
#define ReplaceFile ReplaceFileA
WINBASEAPI BOOL WINAPI
ReplaceFileA(LPCSTR,LPCSTR,LPCSTR,DWORD,LPVOID,LPVOID);


Similar is the way winbase.h is setup in the MinGW header.

If I try to use the MinGW header, of course I get a file type error.

Have I hit a brick wall ?

    Thanks,
    Ed



reply via email to

[Prev in Thread] Current Thread [Next in Thread]