History

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.

grischka committed 15 years ago

Commit f332bb31 parent 9bd69bf1 file · +5 −5Browse files

Unified · Split

tccpe.c+5−5
@@ -62,7 +62,7 @@ void dbg_printf (const char *fmt, ...) · 61 unmodified lines
6262
6363 typedef unsigned char BYTE;
6464 typedef unsigned short WORD;
65−typedef unsigned long DWORD;
65+typedef unsigned int DWORD;
6666 typedef unsigned long long ULONGLONG;
6767 #pragma pack(push, 1)
6868
@@ -600,7 +600,7 @@ static int pe_write(struct pe_info *pe) · 531 unmodified lines
600600 printf("-------------------------------"
601601 "\n virt file size section" "\n");
602602 for (i = 0; i < pe->sec_count; ++i) {
603− unsigned long addr, size;
603+ DWORD addr, size;
604604 const char *sh_name;
605605
606606 si = pe->sec_info + i;
@@ -610,8 +610,8 @@ static int pe_write(struct pe_info *pe) · 3 unmodified lines
610610 psh = &si->ish;
611611
612612 if (2 == pe->s1->verbose)
613− printf("%6lx %6lx %6lx %s\n",
614− addr, file_offset, size, sh_name);
613+ printf("%6x %6x %6x %s\n",
614+ (unsigned)addr, (unsigned)file_offset, (unsigned)size, sh_name);
615615
616616 switch (si->cls) {
617617 case sec_text:
@@ -706,7 +706,7 @@ static int pe_write(struct pe_info *pe) · 88 unmodified lines
706706 if (2 == pe->s1->verbose)
707707 printf("-------------------------------\n");
708708 if (pe->s1->verbose)
709− printf("<- %s (%lu bytes)\n", pe->filename, file_offset);
709+ printf("<- %s (%u bytes)\n", pe->filename, (unsigned)file_offset);
710710
711711 return 0;
712712 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t