Loading...
Searching...
No Matches
version.hh
Go to the documentation of this file.
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
#ifndef DUNE_VERSION_HH
#define DUNE_VERSION_HH
#include <dune-common-config.hh> // DUNE_[MODULE]_VERSION_[TYPE]
#define DUNE_VERSION_JOIN(module,type) module ## _VERSION_ ## type
#define DUNE_VERSION_EQUAL(module,major,minor) \
((DUNE_VERSION_JOIN(module,MAJOR) == major) && \
(DUNE_VERSION_JOIN(module,MINOR) == minor))
#define DUNE_VERSION_EQUAL_REV(module,major,minor,revision) \
( DUNE_VERSION_EQUAL(module,major,minor) && \
(DUNE_VERSION_JOIN(module,REVISION) == revision))
#define DUNE_VERSION_GTE(module,major,minor) \
((DUNE_VERSION_JOIN(module,MAJOR) > major) \
|| ((DUNE_VERSION_JOIN(module,MAJOR) == major) && (DUNE_VERSION_JOIN(module,MINOR) >= minor)))
#define DUNE_VERSION_LT(module,major,minor) \
! DUNE_VERSION_GTE(module,major,minor)
#define DUNE_VERSION_GT(module,major,minor) \
((DUNE_VERSION_JOIN(module,MAJOR) > major) \
|| ((DUNE_VERSION_JOIN(module,MAJOR) == major) && (DUNE_VERSION_JOIN(module,MINOR) > minor)))
#define DUNE_VERSION_LTE(module,major,minor) \
! DUNE_VERSION_GT(module,major,minor)
#define DUNE_VERSION_GTE_REV(module,major,minor,revision) \
((DUNE_VERSION_JOIN(module,MAJOR) > major) \
|| ((DUNE_VERSION_JOIN(module,MAJOR) == major) && (DUNE_VERSION_JOIN(module,MINOR) > minor)) \
|| ((DUNE_VERSION_JOIN(module,MAJOR) == major) && (DUNE_VERSION_JOIN(module,MINOR) == minor) \
&& (DUNE_VERSION_JOIN(module,REVISION) >= revision)))
#define DUNE_VERSION_LT_REV(module,major,minor,revision) \
! DUNE_VERSION_GTE_REV(module,major,minor,revision)
#define DUNE_VERSION_GT_REV(module,major,minor,revision) \
((DUNE_VERSION_JOIN(module,MAJOR) > major) \
|| ((DUNE_VERSION_JOIN(module,MAJOR) == major) && (DUNE_VERSION_JOIN(module,MINOR) > minor)) \
|| ((DUNE_VERSION_JOIN(module,MAJOR) == major) && (DUNE_VERSION_JOIN(module,MINOR) == minor) \
&& (DUNE_VERSION_JOIN(module,REVISION) > revision)))
#define DUNE_VERSION_LTE_REV(module,major,minor,revision) \
! DUNE_VERSION_GT_REV(module,major,minor,revision)
#define DUNE_VERSION_ID(major,minor,revision) \
((unsigned int)((major << 24) + (minor << 16) + revision))
#define DUNE_MODULE_VERSION_ID(module) \
DUNE_VERSION_ID( DUNE_VERSION_JOIN(module,MAJOR), DUNE_VERSION_JOIN(module,MINOR), DUNE_VERSION_JOIN(module,REVISION) )
#endif