diff options
| author | grischka <grischka> | 2010-11-27 15:02:57 +0100 |
|---|---|---|
| committer | grischka <grischka> | 2010-11-27 15:02:57 +0100 |
| commit | f332bb3bcad242428eb91bd97767ca2c1c10d00f (patch) | |
| tree | f5b1cba52b51190c0f1b2a006c6749c83bc9677a | |
| parent | 9bd69bf49fb37554d199d0040c81bea009d43092 (diff) | |
| download | tinycc-f332bb3bcad242428eb91bd97767ca2c1c10d00f.tar.gz tinycc-f332bb3bcad242428eb91bd97767ca2c1c10d00f.tar.bz2 | |
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.
| -rw-r--r-- | tccpe.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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; } |
