source: trunk/contrib/cppunit-1.12.2/include/cppunit/config/SelectDllLoader.h @ 876

Last change on this file since 876 was 876, checked in by sam, 9 years ago

contrib: add a precompiled Win32 version of CppUnit and update build system
accordingly.

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