SelectDllLoader.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #ifndef CPPUNIT_CONFIG_SELECTDLLLOADER_H
  2. #define CPPUNIT_CONFIG_SELECTDLLLOADER_H
  3. /*! \file
  4. * Selects DynamicLibraryManager implementation.
  5. *
  6. * Don't include this file directly. Include Portability.h instead.
  7. */
  8. /*!
  9. * \def CPPUNIT_NO_TESTPLUGIN
  10. * \brief If defined, then plug-in related classes and functions will not be compiled.
  11. *
  12. * \internal
  13. * CPPUNIT_HAVE_WIN32_DLL_LOADER
  14. * If defined, Win32 implementation of DynamicLibraryManager will be used.
  15. *
  16. * CPPUNIT_HAVE_BEOS_DLL_LOADER
  17. * If defined, BeOs implementation of DynamicLibraryManager will be used.
  18. *
  19. * CPPUNIT_HAVE_UNIX_DLL_LOADER
  20. * If defined, Unix implementation (dlfcn.h) of DynamicLibraryManager will be used.
  21. */
  22. /*!
  23. * \def CPPUNIT_PLUGIN_EXPORT
  24. * \ingroup WritingTestPlugIn
  25. * \brief A macro to export a function from a dynamic library
  26. *
  27. * This macro export the C function following it from a dynamic library.
  28. * Exporting the function makes it accessible to the DynamicLibraryManager.
  29. *
  30. * Example of usage:
  31. * \code
  32. * #include <cppunit/include/plugin/TestPlugIn.h>
  33. *
  34. * CPPUNIT_PLUGIN_EXPORT CppUnitTestPlugIn *CPPUNIT_PLUGIN_EXPORTED_NAME(void)
  35. * {
  36. * ...
  37. * return &myPlugInInterface;
  38. * }
  39. * \endcode
  40. */
  41. #if !defined(CPPUNIT_NO_TESTPLUGIN)
  42. // Is WIN32 platform ?
  43. #if defined(WIN32)
  44. #define CPPUNIT_HAVE_WIN32_DLL_LOADER 1
  45. #undef CPPUNIT_PLUGIN_EXPORT
  46. #define CPPUNIT_PLUGIN_EXPORT extern "C" __declspec(dllexport)
  47. // Is BeOS platform ?
  48. #elif defined(__BEOS__)
  49. #define CPPUNIT_HAVE_BEOS_DLL_LOADER 1
  50. // Is Unix platform and have shl_load() (hp-ux)
  51. #elif defined(CPPUNIT_HAVE_SHL_LOAD)
  52. #define CPPUNIT_HAVE_UNIX_SHL_LOADER 1
  53. // Is Unix platform and have include <dlfcn.h>
  54. #elif defined(CPPUNIT_HAVE_LIBDL)
  55. #define CPPUNIT_HAVE_UNIX_DLL_LOADER 1
  56. // Otherwise, disable support for DllLoader
  57. #else
  58. #define CPPUNIT_NO_TESTPLUGIN 1
  59. #endif
  60. #if !defined(CPPUNIT_PLUGIN_EXPORT)
  61. #define CPPUNIT_PLUGIN_EXPORT extern "C"
  62. #endif // !defined(CPPUNIT_PLUGIN_EXPORT)
  63. #endif // !defined(CPPUNIT_NO_TESTPLUGIN)
  64. #endif // CPPUNIT_CONFIG_SELECTDLLLOADER_H