diff options
| author | grischka <grischka> | 2014-08-01 10:51:28 +0200 |
|---|---|---|
| committer | grischka <grischka> | 2014-08-01 10:51:28 +0200 |
| commit | 12f43953edd48dc1e3520fa944e79e9da642651e (patch) | |
| tree | 8ab0ff0d3902ad9882dec6a7c4827ab439bdf2e8 /win32/tools | |
| parent | 73a7dd79aff5ca035637b5f9529478f8fcea0532 (diff) | |
| download | tinycc-12f43953edd48dc1e3520fa944e79e9da642651e.tar.gz tinycc-12f43953edd48dc1e3520fa944e79e9da642651e.tar.bz2 | |
win64: fix resource file support
Diffstat (limited to 'win32/tools')
| -rw-r--r-- | win32/tools/tiny_impdef.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/win32/tools/tiny_impdef.c b/win32/tools/tiny_impdef.c index d12c502..48de44f 100644 --- a/win32/tools/tiny_impdef.c +++ b/win32/tools/tiny_impdef.c @@ -158,6 +158,14 @@ int read_mem(int fd, unsigned offset, void *buffer, unsigned len) /* -------------------------------------------------------------- */ +#if defined TCC_TARGET_X86_64 +# define IMAGE_FILE_MACHINE 0x8664 +#elif defined TCC_TARGET_ARM +# define IMAGE_FILE_MACHINE 0x01C0 +#elif 1 /* defined TCC_TARGET_I386 */ +# define IMAGE_FILE_MACHINE 0x014C +#endif + /* -------------------------------------------------------------- */ #endif @@ -173,10 +181,8 @@ char *get_export_names(int fd) DWORD sig, ref, addr, ptr, namep; #ifdef TCC_TARGET_X86_64 IMAGE_OPTIONAL_HEADER64 oh; - const int MACHINE = 0x8664; #else IMAGE_OPTIONAL_HEADER32 oh; - const int MACHINE = 0x014C; #endif int pef_hdroffset, opt_hdroffset, sec_hdroffset; @@ -192,7 +198,7 @@ char *get_export_names(int fd) pef_hdroffset = dh.e_lfanew + sizeof sig; if (!read_mem(fd, pef_hdroffset, &ih, sizeof ih)) goto the_end; - if (MACHINE != ih.Machine) + if (IMAGE_FILE_MACHINE != ih.Machine) goto the_end; opt_hdroffset = pef_hdroffset + sizeof ih; sec_hdroffset = opt_hdroffset + sizeof oh; |
