stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Farid Zaripov" <Far...@kyiv.vdiweb.com>
Subject _RWSTD_TEST_SRC define used in build of tests in "... Dll" configurations
Date Thu, 14 Sep 2006 17:27:06 GMT
  The tests in "... Dll" (8d, 11d, 12d, 15d) configurations are
compiling with defined _RWSTD_TEST_SRC macro.
I think it's unnecessary. I have investigated what for this define used
and found that is used to disable
__declspec (dllimport) keyword because the rwtest library is always
compiled as static library, but
_RWSHARED macro (which is defined because the stdlib is dynamic library)
forces __declspec(dllimport)
without _RWSTD_TEST_SRC defined.

  Another (minor) issue is that librarian creates export files
rwtest.exp (due to __declspec (dllexport)) which are useless.

  I see two ways to improve this:
1) generate rwtest as dynamic library when stdlib is dynamic library
2) generate rwtest always as static library and rename _RWSHARED macro
to _RWTESTSHARED (or any other)
in testdefs.h (to save possibility of generation rwtest library as
dynamic library).

  I don't know what about RWDLL macro, but it's not defined anywhere.

  I prefer the variant 2) because in that case the tests binaries are
independent from additional binary (rwtest.dll).

tests\include\testdefs.h:
--------------------------

#if    (defined (_WIN32) || defined (_WIN64)) \
    && (defined (RWDLL) || defined (_RWSHARED))
#  ifndef _RWSTD_TEST_SRC
     // using a shared lib, import names
#    define _TEST_EXPORT   __declspec (dllimport)
#  else
     // building a shared (test) lib, export names
#    define _TEST_EXPORT   __declspec (dllexport)
#  endif   // _RWSTD_LIB_SRC
#else
#    define _TEST_EXPORT
#endif   // archive/shared library
--------------------------

Farid.

Mime
View raw message