From 92260e7d0bbe5915f1c63f9036d6b7fd255bee22 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 17 Feb 2020 11:43:20 +0100 Subject: [PATCH] [libcalamares] Document DllMacro.h and add STATICTEST - document the export macros - introduce a "static" that is switched off when re-building code for tests. --- src/libcalamares/DllMacro.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/libcalamares/DllMacro.h b/src/libcalamares/DllMacro.h index 865d91d57..9bb789c94 100644 --- a/src/libcalamares/DllMacro.h +++ b/src/libcalamares/DllMacro.h @@ -21,6 +21,10 @@ #include +/* + * Mark symbols exported from Calamares libraries with DLLEXPORT. + * These are the public API of the libraries. + */ #ifndef DLLEXPORT #if defined( DLLEXPORT_PRO ) #define DLLEXPORT Q_DECL_EXPORT @@ -29,6 +33,11 @@ #endif #endif +/* + * Mark symbols exported from Calamares C++ plugins with PLUGINDLLEXPORT. + * These are the public API of the libraries (generally, the plugin + * entry point) + */ #ifndef PLUGINDLLEXPORT #if defined( PLUGINDLLEXPORT_PRO ) #define PLUGINDLLEXPORT Q_DECL_EXPORT @@ -37,4 +46,17 @@ #endif #endif +/* + * For functions that should be static in production but also need to + * be tested, use STATICTEST as linkage specifier. When built as part + * of a test, the function will be given normal linkage. + */ +#ifndef STATICTEST +#if defined( BUILD_AS_TEST ) +#define STATICTEST +#else +#define STATICTEST static +#endif +#endif + #endif