NEURON
nrnversionmacros.h
Go to the documentation of this file.
1 #pragma once
2 #include "nrnsemanticversion.h"
3 #define NRN_VERSION_INT(maj, min, pat) (10000 * maj + 100 * min + pat)
4 #define NRN_VERSION NRN_VERSION_INT(NRN_VERSION_MAJOR, NRN_VERSION_MINOR, NRN_VERSION_PATCH)
5 #define NRN_VERSION_EQ(maj, min, pat) (NRN_VERSION == NRN_VERSION_INT(maj, min, pat))
6 #define NRN_VERSION_NE(maj, min, pat) (NRN_VERSION != NRN_VERSION_INT(maj, min, pat))
7 #define NRN_VERSION_GT(maj, min, pat) (NRN_VERSION > NRN_VERSION_INT(maj, min, pat))
8 #define NRN_VERSION_LT(maj, min, pat) (NRN_VERSION < NRN_VERSION_INT(maj, min, pat))
9 #define NRN_VERSION_GTEQ(maj, min, pat) (NRN_VERSION >= NRN_VERSION_INT(maj, min, pat))
10 #define NRN_VERSION_LTEQ(maj, min, pat) (NRN_VERSION <= NRN_VERSION_INT(maj, min, pat))
11 
12 /* 8.2.0 is significant because all versions >=8.2.0 should contain definitions
13  * of these macros, and doing #ifndef NRN_VERSION_GTEQ_8_2_0 is a more
14  * descriptive way of writing #if defined(NRN_VERSION_GTEQ). Testing for 8.2.0
15  * is likely to be a common pattern when adapting MOD file VERBATIM blocks for
16  * C++ compatibility.
17  */
18 #if NRN_VERSION_GTEQ(8, 2, 0)
19 #define NRN_VERSION_GTEQ_8_2_0
20 #endif
21 
22 // Around NEURON 9.0.0 there are significant changes to data structures, which in some cases require
23 // that VERBATIM code is adapted.
24 #if NRN_VERSION_LT(9, 0, 0)
25 #error "Changes from NEURON 9+ may have been erroneously backported to an older branch"
26 #else
27 // Used to test if floating point mechanism data are accessed via a double* (_p) or via a Memb_list*
28 // and std::size_t pair (_ml and _iml)
29 #define NRN_MECHANISM_DATA_IS_SOA // _ml and _iml are used
30 #endif