summaryrefslogtreecommitdiff
path: root/ms
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2005-11-09 17:11:03 +0000
committerAndy Polyakov <appro@openssl.org>2005-11-09 17:11:03 +0000
commit2c730f6fc294357eb032e8ad85d51d40738f2290 (patch)
treece66bb7b256e51b8be94939f110ffde2d673a11b /ms
parentdf8dae1df4a03cdf61e87c605ebacf8aa6064890 (diff)
downloadopenssl-new-2c730f6fc294357eb032e8ad85d51d40738f2290.tar.gz
Improve cross-compiler portability of applink.c module and mention
CRYPTO_malloc_init in FAQ.
Diffstat (limited to 'ms')
-rw-r--r--ms/applink.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/ms/applink.c b/ms/applink.c
index e2d066bc1e..54a0a64262 100644
--- a/ms/applink.c
+++ b/ms/applink.c
@@ -39,7 +39,20 @@ static int app_fileno(FILE *fp) { return _fileno(fp); }
static int app_fsetmod(FILE *fp,char mod)
{ return _setmode (_fileno(fp),mod=='b'?_O_BINARY:_O_TEXT); }
-__declspec(dllexport) void **OPENSSL_Applink(void)
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+__declspec(dllexport)
+void **
+#if defined(__BORLANDC__)
+__stdcall /* __stdcall appears to be the only way to get the name
+ * decoration right with Borland C. Otherwise it works
+ * purely incidentally, as we pass no parameters. */
+#else
+__cdecl
+#endif
+OPENSSL_Applink(void)
{ static int once=1;
static void *OPENSSL_ApplinkTable[APPLINK_MAX+1]={(void *)APPLINK_MAX};
@@ -74,4 +87,8 @@ __declspec(dllexport) void **OPENSSL_Applink(void)
return OPENSSL_ApplinkTable;
}
+
+#ifdef __cplusplus
+}
+#endif
#endif