tccpe: typedef unsigned int DWORD for cross compilers.
This fixes the i386-win32-tcc cross-compiler on x86-64 linux platform. I verified that it produces identical binaries for 'hello_win.exe' and 'tcc.exe' (tcc compiled by itself) compared to the output of the native tcc on windows.
This commit is contained in:
parent
9bd69bf49f
commit
f332bb3bca
1 changed files with 5 additions and 5 deletions
10
tccpe.c
10
tccpe.c
|
@ -62,7 +62,7 @@ void dbg_printf (const char *fmt, ...)
|
|||
|
||||
typedef unsigned char BYTE;
|
||||
typedef unsigned short WORD;
|
||||
typedef unsigned long DWORD;
|
||||
typedef unsigned int DWORD;
|
||||
typedef unsigned long long ULONGLONG;
|
||||
#pragma pack(push, 1)
|
||||
|
||||
|
@ -600,7 +600,7 @@ static int pe_write(struct pe_info *pe)
|
|||
printf("-------------------------------"
|
||||
"\n virt file size section" "\n");
|
||||
for (i = 0; i < pe->sec_count; ++i) {
|
||||
unsigned long addr, size;
|
||||
DWORD addr, size;
|
||||
const char *sh_name;
|
||||
|
||||
si = pe->sec_info + i;
|
||||
|
@ -610,8 +610,8 @@ static int pe_write(struct pe_info *pe)
|
|||
psh = &si->ish;
|
||||
|
||||
if (2 == pe->s1->verbose)
|
||||
printf("%6lx %6lx %6lx %s\n",
|
||||
addr, file_offset, size, sh_name);
|
||||
printf("%6x %6x %6x %s\n",
|
||||
(unsigned)addr, (unsigned)file_offset, (unsigned)size, sh_name);
|
||||
|
||||
switch (si->cls) {
|
||||
case sec_text:
|
||||
|
@ -706,7 +706,7 @@ static int pe_write(struct pe_info *pe)
|
|||
if (2 == pe->s1->verbose)
|
||||
printf("-------------------------------\n");
|
||||
if (pe->s1->verbose)
|
||||
printf("<- %s (%lu bytes)\n", pe->filename, file_offset);
|
||||
printf("<- %s (%u bytes)\n", pe->filename, (unsigned)file_offset);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue