summaryrefslogtreecommitdiff
path: root/tests/DLL_Test.cpp
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1999-06-26 20:23:33 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1999-06-26 20:23:33 +0000
commite7149fedca3454c09a4720fc23811e4d5f0e452f (patch)
treed269170a79ef00965dd19605afe35939a2d8a730 /tests/DLL_Test.cpp
parent1b4fd30d6aa717eecf6604c2d6b3a29e625e89d0 (diff)
downloadATCD-e7149fedca3454c09a4720fc23811e4d5f0e452f.tar.gz
.
Diffstat (limited to 'tests/DLL_Test.cpp')
-rw-r--r--tests/DLL_Test.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/tests/DLL_Test.cpp b/tests/DLL_Test.cpp
index 73d503e27e6..56efc8bdcd9 100644
--- a/tests/DLL_Test.cpp
+++ b/tests/DLL_Test.cpp
@@ -42,13 +42,29 @@ USELIB("..\ace\aced.lib");
#if defined (ACE_WIN32)
# define OBJ_SUFFIX ".exe"
-# define OBJ_PREFIX ""
+# if defined (__BORLANDC__)
+# define OBJ_PREFIX ".\\bor\\bin\\"
+# else
+# define OBJ_PREFIX ""
+# endif /* defined (__BORLANDC__) */
#else
# define OBJ_SUFFIX ACE_DLL_SUFFIX
# define OBJ_PREFIX "./" ACE_DLL_PREFIX
#endif /*ACE_WIN32*/
+static char const *
+cdecl_decoration(char const * func_name)
+{
+#if defined(__BORLANDC__)
+ static char decorated_func_name[10*1024];
+ ACE_OS::sprintf(decorated_func_name, "_%s", func_name);
+ return decorated_func_name;
+#else
+ return func_name;
+#endif
+}
+
// This function returns the Hello object pointer.
extern "C" ACE_Svc_Export Hello *get_hello (void);
@@ -79,7 +95,6 @@ main (int argc, char *argv[])
defined (__hpux)
ACE_DLL dll;
-
int retval = dll.open (OBJ_PREFIX "DLL_Test" OBJ_SUFFIX);
if (retval != 0)
ACE_ERROR_RETURN ((LM_ERROR,
@@ -91,13 +106,11 @@ main (int argc, char *argv[])
// function pointer. Doesnt allow:TC f = (TC) dll.symbol ("get_hello");
void * foo;
- foo = dll.symbol ("get_hello");
+ foo = dll.symbol (cdecl_decoration("get_hello"));
// Cast the void* to long first.
long tmp = ACE_reinterpret_cast (long, foo);
-
TC f = ACE_reinterpret_cast (Hello * (*)(void), tmp);
-
if (f == 0)
ACE_ERROR_RETURN ((LM_ERROR,
"%p\n",