OpenMS
openswathalgo/include/OpenMS/OPENSWATHALGO/Macros.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Hannes Roest $
6 // $Authors: Hannes Roest $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 #include <cassert>
12 
13 // Simple implementation of PRE and POST conditions using assert (should be on
14 // during debug mode and off during release mode) with a informative message
15 // which is printed alongside the dump.
16 // see http://stackoverflow.com/questions/3692954/add-custom-messages-in-assert
17 // "Since a pointer "is true" if it's non-null, you can use the &&-operator to
18 // chain and display the message".
19 #define OPENSWATH_PRECONDITION(condition, message)\
20  assert( (condition) && (message));
21 
22 #define OPENSWATH_POSTCONDITION(condition, message)\
23  assert( (condition) && (message));
24