lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 35acf2a 03/30: Force linking CLI alert initia


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 35acf2a 03/30: Force linking CLI alert initialization functions into the tests
Date: Wed, 24 Mar 2021 15:31:07 -0400 (EDT)

branch: master
commit 35acf2a7fecc419f459bad78bfbf6ffcdb8a867a
Author: Vadim Zeitlin <vadim@tt-solutions.com>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Force linking CLI alert initialization functions into the tests
    
    Ensure that alert function pointers are always set, even if
    alert_cli.cpp itself is not compiled as part of the test.
---
 alert_cli.cpp | 4 ++++
 test_main.cpp | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/alert_cli.cpp b/alert_cli.cpp
index 46872a0..36ad1e2 100644
--- a/alert_cli.cpp
+++ b/alert_cli.cpp
@@ -23,10 +23,14 @@
 
 #include "alert.hpp"
 
+#include "force_linking.hpp"
+
 #include <cstdio>                       // getchar()
 #include <iostream>
 #include <stdexcept>
 
+LMI_FORCE_LINKING_IN_SITU(alert_cli)
+
 namespace
 {
 bool volatile ensure_setup = set_alert_functions
diff --git a/test_main.cpp b/test_main.cpp
index 8e8006c..922a4e0 100644
--- a/test_main.cpp
+++ b/test_main.cpp
@@ -60,6 +60,7 @@
 
 #include "exit_codes.hpp"
 #include "fenv_lmi.hpp"
+#include "force_linking.hpp"
 #include "miscellany.hpp"               // stifle_warning_for_unused_value()
 #include "test_tools.hpp"
 
@@ -70,6 +71,8 @@
 #include <stdexcept>
 #include <string>
 
+LMI_FORCE_LINKING_EX_SITU(alert_cli)
+
 // GWC changed namespace 'boost' to prevent any conflict with code in
 // a later version of boost.
 namespace lmi_test



reply via email to

[Prev in Thread] Current Thread [Next in Thread]