diff --git a/lib/3rdparty/mingw/crt_handler.c b/lib/3rdparty/mingw/crt_handler.c index 8e47df0a6c1..34b5170c2df 100644 --- a/lib/3rdparty/mingw/crt_handler.c +++ b/lib/3rdparty/mingw/crt_handler.c @@ -16,7 +16,9 @@ #if defined (_WIN64) && defined (__ia64__) #error FIXME: Unsupported __ImageBase implementation. #else +#ifndef _MSC_VER #define __ImageBase __MINGW_LSYMBOL(_image_base__) +#endif /* This symbol is defined by the linker. */ extern IMAGE_DOS_HEADER __ImageBase; #endif diff --git a/lib/3rdparty/mingw/crtexe.c b/lib/3rdparty/mingw/crtexe.c index a677301c9d8..daab5cd5984 100644 --- a/lib/3rdparty/mingw/crtexe.c +++ b/lib/3rdparty/mingw/crtexe.c @@ -33,7 +33,10 @@ extern char *** __MINGW_IMP_SYMBOL(__initenv); #endif /* Hack, for bug in ld. Will be removed soon. */ +#ifndef _MSC_VER #define __ImageBase __MINGW_LSYMBOL(_image_base__) +#endif + /* This symbol is defined by ld. */ extern IMAGE_DOS_HEADER __ImageBase; diff --git a/lib/3rdparty/mingw/pesect.c b/lib/3rdparty/mingw/pesect.c index 60bbbc4c0d0..38677532aeb 100644 --- a/lib/3rdparty/mingw/pesect.c +++ b/lib/3rdparty/mingw/pesect.c @@ -11,7 +11,9 @@ #error FIXME: Unsupported __ImageBase implementation. #else /* Hack, for bug in ld. Will be removed soon. */ +#ifndef _MSC_VER #define __ImageBase __MINGW_LSYMBOL(_image_base__) +#endif /* This symbol is defined by the linker. */ extern IMAGE_DOS_HEADER __ImageBase; #endif diff --git a/lib/3rdparty/mingw/pseudo-reloc.c b/lib/3rdparty/mingw/pseudo-reloc.c index 77f041114d7..d87b3dc5709 100644 --- a/lib/3rdparty/mingw/pseudo-reloc.c +++ b/lib/3rdparty/mingw/pseudo-reloc.c @@ -46,7 +46,10 @@ extern char __RUNTIME_PSEUDO_RELOC_LIST__; extern char __RUNTIME_PSEUDO_RELOC_LIST_END__; -extern char __MINGW_LSYMBOL(_image_base__); +#ifndef _MSC_VER +#define __ImageBase __MINGW_LSYMBOL(_image_base__) +#endif +extern char __ImageBase; void _pei386_runtime_relocator (void); @@ -363,5 +366,5 @@ _pei386_runtime_relocator (void) ++was_init; do_pseudo_reloc (&__RUNTIME_PSEUDO_RELOC_LIST__, &__RUNTIME_PSEUDO_RELOC_LIST_END__, - &__MINGW_LSYMBOL(_image_base__)); + &__ImageBase); }