From e65790224e880dbf38d833458b400e53da1e13a1 Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Wed, 11 Oct 2017 16:32:35 +0200 Subject: [PATCH] replace #if HAVE_CONFIG_H by #ifdef HAVE_CONFIG_H it seems like most build systems pass a -DHAVE_CONFIG_H flag to the compiler which still causes `#if HAVE_CONFIG_H` to be false while it clearly is supposed to be triggered. That said, I do not really see a good reason why the inclusion of the `config.h` file should be guarded in the first place: the file is guaranteed to always available by proper build systems, and if it was not included the build either breaks at the linking stage or -- at the very least -- the runtime behavior of the resulting libraries will be very awkward. --- examples/flow_legacy.cpp | 2 +- examples/flow_mpi.cpp | 2 +- examples/flow_multisegment.cpp | 2 +- examples/flow_multisegment_mpi.cpp | 2 +- examples/flow_polymer.cpp | 2 +- examples/flow_reorder.cpp | 2 +- examples/flow_sequential.cpp | 2 +- examples/flow_solvent.cpp | 2 +- examples/sim_2p_comp_reorder.cpp | 2 +- examples/sim_2p_incomp.cpp | 2 +- examples/sim_2p_incomp_ad.cpp | 2 +- examples/sim_poly2p_comp_reorder.cpp | 2 +- examples/sim_poly2p_incomp_reorder.cpp | 2 +- opm/autodiff/SimulatorIncompTwophaseAd.cpp | 2 +- opm/polymer/SimulatorCompressiblePolymer.cpp | 2 +- opm/polymer/SimulatorPolymer.cpp | 2 +- opm/simulators/SimulatorCompressibleTwophase.cpp | 2 +- opm/simulators/SimulatorIncompTwophase.cpp | 2 +- opm/simulators/WellSwitchingLogger.cpp | 2 +- tests/test_singlecellsolves.cpp | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/examples/flow_legacy.cpp b/examples/flow_legacy.cpp index e40a412e2..fb9982a58 100644 --- a/examples/flow_legacy.cpp +++ b/examples/flow_legacy.cpp @@ -20,7 +20,7 @@ */ -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif // HAVE_CONFIG_H diff --git a/examples/flow_mpi.cpp b/examples/flow_mpi.cpp index 5356207ff..184cb577b 100644 --- a/examples/flow_mpi.cpp +++ b/examples/flow_mpi.cpp @@ -20,7 +20,7 @@ */ -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif // HAVE_CONFIG_H diff --git a/examples/flow_multisegment.cpp b/examples/flow_multisegment.cpp index cfb113bf3..32fbb8f83 100644 --- a/examples/flow_multisegment.cpp +++ b/examples/flow_multisegment.cpp @@ -20,7 +20,7 @@ */ -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif // HAVE_CONFIG_H diff --git a/examples/flow_multisegment_mpi.cpp b/examples/flow_multisegment_mpi.cpp index e9a78fcdf..5862ccba7 100644 --- a/examples/flow_multisegment_mpi.cpp +++ b/examples/flow_multisegment_mpi.cpp @@ -20,7 +20,7 @@ */ -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif // HAVE_CONFIG_H diff --git a/examples/flow_polymer.cpp b/examples/flow_polymer.cpp index 9506c0e76..c05a4c489 100644 --- a/examples/flow_polymer.cpp +++ b/examples/flow_polymer.cpp @@ -19,7 +19,7 @@ */ -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif // HAVE_CONFIG_H diff --git a/examples/flow_reorder.cpp b/examples/flow_reorder.cpp index 79956f5a1..a8669b63d 100644 --- a/examples/flow_reorder.cpp +++ b/examples/flow_reorder.cpp @@ -17,7 +17,7 @@ along with OPM. If not, see . */ -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif // HAVE_CONFIG_H diff --git a/examples/flow_sequential.cpp b/examples/flow_sequential.cpp index 5eef64dad..2d6de2c1c 100644 --- a/examples/flow_sequential.cpp +++ b/examples/flow_sequential.cpp @@ -17,7 +17,7 @@ along with OPM. If not, see . */ -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif // HAVE_CONFIG_H diff --git a/examples/flow_solvent.cpp b/examples/flow_solvent.cpp index c7459320c..b4eab97bc 100644 --- a/examples/flow_solvent.cpp +++ b/examples/flow_solvent.cpp @@ -20,7 +20,7 @@ */ -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif // HAVE_CONFIG_H diff --git a/examples/sim_2p_comp_reorder.cpp b/examples/sim_2p_comp_reorder.cpp index 32171bc1d..267e01b02 100644 --- a/examples/sim_2p_comp_reorder.cpp +++ b/examples/sim_2p_comp_reorder.cpp @@ -17,7 +17,7 @@ along with OPM. If not, see . */ -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif // HAVE_CONFIG_H diff --git a/examples/sim_2p_incomp.cpp b/examples/sim_2p_incomp.cpp index e0127ced3..2bf93822e 100644 --- a/examples/sim_2p_incomp.cpp +++ b/examples/sim_2p_incomp.cpp @@ -18,7 +18,7 @@ */ -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif // HAVE_CONFIG_H diff --git a/examples/sim_2p_incomp_ad.cpp b/examples/sim_2p_incomp_ad.cpp index f728a6374..3f7b864ec 100644 --- a/examples/sim_2p_incomp_ad.cpp +++ b/examples/sim_2p_incomp_ad.cpp @@ -19,7 +19,7 @@ -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif // HAVE_CONFIG_H diff --git a/examples/sim_poly2p_comp_reorder.cpp b/examples/sim_poly2p_comp_reorder.cpp index 9fd99e08a..0e5a5d8f5 100644 --- a/examples/sim_poly2p_comp_reorder.cpp +++ b/examples/sim_poly2p_comp_reorder.cpp @@ -18,7 +18,7 @@ */ -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif // HAVE_CONFIG_H diff --git a/examples/sim_poly2p_incomp_reorder.cpp b/examples/sim_poly2p_incomp_reorder.cpp index 0ab575dc8..ea45802db 100644 --- a/examples/sim_poly2p_incomp_reorder.cpp +++ b/examples/sim_poly2p_incomp_reorder.cpp @@ -18,7 +18,7 @@ */ -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif // HAVE_CONFIG_H diff --git a/opm/autodiff/SimulatorIncompTwophaseAd.cpp b/opm/autodiff/SimulatorIncompTwophaseAd.cpp index 487a0d4a6..86c17dabc 100644 --- a/opm/autodiff/SimulatorIncompTwophaseAd.cpp +++ b/opm/autodiff/SimulatorIncompTwophaseAd.cpp @@ -18,7 +18,7 @@ */ -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif // HAVE_CONFIG_H diff --git a/opm/polymer/SimulatorCompressiblePolymer.cpp b/opm/polymer/SimulatorCompressiblePolymer.cpp index 835d70931..de87ec606 100644 --- a/opm/polymer/SimulatorCompressiblePolymer.cpp +++ b/opm/polymer/SimulatorCompressiblePolymer.cpp @@ -17,7 +17,7 @@ along with OPM. If not, see . */ -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif // HAVE_CONFIG_H diff --git a/opm/polymer/SimulatorPolymer.cpp b/opm/polymer/SimulatorPolymer.cpp index c2a898543..d6289f0b1 100644 --- a/opm/polymer/SimulatorPolymer.cpp +++ b/opm/polymer/SimulatorPolymer.cpp @@ -18,7 +18,7 @@ */ -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif // HAVE_CONFIG_H diff --git a/opm/simulators/SimulatorCompressibleTwophase.cpp b/opm/simulators/SimulatorCompressibleTwophase.cpp index 424787fa9..1d69fb944 100644 --- a/opm/simulators/SimulatorCompressibleTwophase.cpp +++ b/opm/simulators/SimulatorCompressibleTwophase.cpp @@ -17,7 +17,7 @@ along with OPM. If not, see . */ -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif // HAVE_CONFIG_H diff --git a/opm/simulators/SimulatorIncompTwophase.cpp b/opm/simulators/SimulatorIncompTwophase.cpp index 8c2996686..72606fe4e 100644 --- a/opm/simulators/SimulatorIncompTwophase.cpp +++ b/opm/simulators/SimulatorIncompTwophase.cpp @@ -17,7 +17,7 @@ along with OPM. If not, see . */ -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif // HAVE_CONFIG_H diff --git a/opm/simulators/WellSwitchingLogger.cpp b/opm/simulators/WellSwitchingLogger.cpp index 92e9b5c20..3974aff18 100644 --- a/opm/simulators/WellSwitchingLogger.cpp +++ b/opm/simulators/WellSwitchingLogger.cpp @@ -18,7 +18,7 @@ along with OPM. If not, see . */ -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif // HAVE_CONFIG_H diff --git a/tests/test_singlecellsolves.cpp b/tests/test_singlecellsolves.cpp index 211a6063a..c7f39840c 100644 --- a/tests/test_singlecellsolves.cpp +++ b/tests/test_singlecellsolves.cpp @@ -18,7 +18,7 @@ */ -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif // HAVE_CONFIG_H