Fix test cases/common/135 on Cygwin
I don't really know how to explain this briefly... If you don't decorate this with dllimport, then a Cygwin runtime relocation is used (a so called 'pseudo-reloc'). As the relocation offset is only 32 bits, this can fail on x86_64 if the DLL happens to be loaded more than 2GB away from the reference. If you decorate with dllimport, then access is indirected via a pointer, imp_square_unsigned, which is fixed up by the loader.
This commit is contained in:
parent
320490cd00
commit
8a2699acd0
|
@ -1,5 +1,8 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||||
|
__declspec(dllimport)
|
||||||
|
#endif
|
||||||
unsigned square_unsigned (unsigned a);
|
unsigned square_unsigned (unsigned a);
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
Loading…
Reference in New Issue