From aa80e5b1ff9a0dedb5a41916716870345033ca30 Mon Sep 17 00:00:00 2001 From: grischka Date: Thu, 14 Jul 2011 19:23:04 +0200 Subject: tccpe: cleanup ELFW() macros etc. --- win32/tools/tiny_libmaker.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'win32/tools') diff --git a/win32/tools/tiny_libmaker.c b/win32/tools/tiny_libmaker.c index c97b509..42373d8 100644 --- a/win32/tools/tiny_libmaker.c +++ b/win32/tools/tiny_libmaker.c @@ -27,6 +27,16 @@ #include "../../elf.h" +#ifdef TCC_TARGET_X86_64 +# define ELFCLASSW ELFCLASS64 +# define ElfW(type) Elf##64##_##type +# define ELFW(type) ELF##64##_##type +#else +# define ELFCLASSW ELFCLASS32 +# define ElfW(type) Elf##32##_##type +# define ELFW(type) ELF##32##_##type +#endif + #define ARMAG "!\n" #define ARFMAG "`\n" @@ -144,7 +154,7 @@ int main(int argc, char **argv) //printf("%s:\n", argv[iarg]); // elf header ehdr = (ElfW(Ehdr) *)buf; - if (ehdr->e_ident[4] != TCC_ELFCLASS) + if (ehdr->e_ident[4] != ELFCLASSW) { fprintf(stderr, "Unsupported Elf Class: %s\n", argv[iarg]); fclose(fo); -- cgit v1.3.1