diff options
Diffstat (limited to 'tests/DLL_Test.cpp')
-rw-r--r-- | tests/DLL_Test.cpp | 23 |
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", |