diff options
Diffstat (limited to 'ms')
-rw-r--r-- | ms/applink.c | 6 | ||||
-rw-r--r-- | ms/uplink.c | 19 |
2 files changed, 23 insertions, 2 deletions
diff --git a/ms/applink.c b/ms/applink.c index d19966a33e..2cf3a92f18 100644 --- a/ms/applink.c +++ b/ms/applink.c @@ -38,6 +38,12 @@ # include <io.h> # include <fcntl.h> +# ifdef __BORLANDC__ + /* _lseek in <io.h> is a function-like macro so we can't take its address */ +# undef _lseek +# define _lseek lseek +# endif + static void *app_stdin(void) { return stdin; diff --git a/ms/uplink.c b/ms/uplink.c index 8c61a7ed1d..f924eb3e58 100644 --- a/ms/uplink.c +++ b/ms/uplink.c @@ -99,14 +99,29 @@ void OPENSSL_Uplink(volatile void **table, int index) table[index] = func; } -#if defined(_MSC_VER) && defined(_M_IX86) -# define LAZY(i) \ +#if (defined(_MSC_VER) || defined(__BORLANDC__)) && defined(_M_IX86) +# if defined(_MSC_VER) +# define LAZY(i) \ __declspec(naked) static void lazy##i (void) { \ _asm push i \ _asm push OFFSET OPENSSL_UplinkTable \ _asm call OPENSSL_Uplink \ _asm add esp,8 \ _asm jmp OPENSSL_UplinkTable+4*i } +# elif defined(__BORLANDC__) && defined(__clang__) +void *OPENSSL_UplinkTable[26]; /* C++Builder requires declaration before use */ +# define LAZY(i) \ +__declspec(naked) static void lazy##i (void) { \ + __asm__("pushl $" #i "; " \ + "pushl %0; " \ + "call %P1; " \ + "addl $8, %%esp; " \ + "jmp *%2 " \ + : /* no outputs */ \ + : "i" (OPENSSL_UplinkTable), \ + "i" (OPENSSL_Uplink), \ + "m" (OPENSSL_UplinkTable[i])); } +# endif # if APPLINK_MAX>25 # error "Add more stubs..." |