Skip to content
Snippets Groups Projects
Commit 46ba3ad4 authored by Christian Engwer's avatar Christian Engwer
Browse files

- get rid DUNE_DEVEL_MODE

- if NDEBUG is not set, CHECK_INTERFACE_IMPLEMENTATION is active
- add proper double-inclusion-protection

[[Imported from SVN: r6331]]
parent a46698b9
No related branches found
No related tags found
No related merge requests found
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_COMMON_BACTONNACKMANIFCHECK_HH
#define DUNE_COMMON_BACTONNACKMANIFCHECK_HH
/** @file
@author Robert Kloefkorn
@brief Provides check for implementation of interface methods when using
......@@ -12,12 +15,9 @@
//- Dune includes
#include <dune/common/exceptions.hh>
#ifndef CHECK_INTERFACE_IMPLEMENTATION
#ifdef NDEBUG
#define CHECK_INTERFACE_IMPLEMENTATION(dummy)
#ifndef NDEBUG
// only do checking if DUNE_DEVEL_MODE is defined aswell
#ifdef DUNE_DEVEL_MODE
#undef CHECK_INTERFACE_IMPLEMENTATION
#else
#define CHECK_INTERFACE_IMPLEMENTATION(__interface_method_to_call__) \
{\
static bool call = false; \
......@@ -35,23 +35,18 @@
} \
}
#endif
#endif
#endif
/** The macro CHECK_AND_CALL_INTERFACE_IMPLEMENTATION throws an exception,
if the interface method ist not implemented and just calls the method
otherwise. If NDEBUG is defined no
checking is done and the method is just called.
*/
#ifndef CHECK_AND_CALL_INTERFACE_IMPLEMENTATION
#ifndef NDEBUG
#define CHECK_AND_CALL_INTERFACE_IMPLEMENTATION(__interface_method_to_call__) \
(__interface_method_to_call__)
#ifndef NDEBUG
// only do checking if DUNE_DEVEL_MODE is defined aswell
#ifdef DUNE_DEVEL_MODE
#undef CHECK_AND_CALL_INTERFACE_IMPLEMENTATION
#else
#define CHECK_AND_CALL_INTERFACE_IMPLEMENTATION(__interface_method_to_call__) \
CHECK_INTERFACE_IMPLEMENTATION(__interface_method_to_call__)
#endif
#endif
#endif
#endif // DUNE_COMMON_BACTONNACKMANIFCHECK_HH
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment