Skip to content

Commit

Permalink
Ban using "defined" as part of a macro's definition
Browse files Browse the repository at this point in the history
  • Loading branch information
hfp committed Oct 28, 2024
1 parent 164f965 commit fe35929
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/base/base_uses.f90
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@
! Usage: CPVERSION_CHECK(9, 5, >, __GNUC__, __GNUC_MINOR__)
! On top of CPVERSION macro, test if MAJOR_TEST and MINOR_TEST are defined.
! Perform actual comparison according to COMP argument.
#define CPVERSION_CHECK(MAJOR_BASE, MINOR_BASE, COMP, MAJOR_TEST, MINOR_TEST) (defined(MAJOR_TEST) && ( \
(defined(MINOR_TEST) && CPVERSION2(MAJOR_BASE,MINOR_BASE) COMP CPVERSION2(MAJOR_TEST,MINOR_TEST)) || \
(CPVERSION2(MAJOR_BASE,MINOR_BASE) COMP MAJOR_TEST)))
#define CPVERSION_CHECK(MAJOR_BASE, MINOR_BASE, COMP, MAJOR_TEST, MINOR_TEST) ((MAJOR_TEST) && (((MINOR_TEST) && \
CPVERSION2(MAJOR_BASE,MINOR_BASE) COMP CPVERSION2(MAJOR_TEST,MINOR_TEST)) || CPVERSION2(MAJOR_BASE,MINOR_BASE) COMP MAJOR_TEST))

! Avoid to default initialize type-components (default c'tor)
#if CPVERSION_CHECK(9, 5, >, __GNUC__, __GNUC_MINOR__) || defined(__INTEL_COMPILER) || defined(__INTEL_LLVM_COMPILER)
Expand Down

0 comments on commit fe35929

Please sign in to comment.