Skip to content

Commit fe32fbd

Browse files
committed
build(include): fix macro logic/syntax
1 parent 58796f6 commit fe32fbd

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

include/language-support.F90

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
! Copyright (c), The Regents of the University of California
22
! Terms of use are as specified in LICENSE.txt
33

4+
#ifdef __GNUC__
5+
# define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
6+
#else
7+
# define GCC_VERSION 0
8+
#endif
9+
410
#ifndef HAVE_SELECTED_LOGICAL_KIND
511
! Define whether the compiler supports standard intrinsic function selected_logical_kind(),
612
! a feature introduced in Fortran 2023 clause 16.9.182.
@@ -15,9 +21,9 @@
1521
! Define whether the compiler supports associating a procedure pointer dummy argument with an
1622
! actual argument that is a valid target for the pointer dummy in a procedure assignment, a
1723
! feature introduced in Fortran 2008 and described in Fortran 2023 clause 15.5.2.10 paragraph 5.
18-
#if defined(_CRAYFTN) || defined(__INTEL_COMPILER) || defined(NAGFOR) || defined(__flang__)
19-
#define HAVE_PROCEDURE_ACTUAL_FOR_POINTER_DUMMY 1
24+
#if defined _CRAYFTN || defined __INTEL_COMPILER || defined NAGFOR || defined __flang__ || (GCC_VERSION > 140200)
25+
# define HAVE_PROCEDURE_ACTUAL_FOR_POINTER_DUMMY 1
2026
#else
21-
#define HAVE_PROCEDURE_ACTUAL_FOR_POINTER_DUMMY 0
27+
# define HAVE_PROCEDURE_ACTUAL_FOR_POINTER_DUMMY 0
2228
#endif
2329
#endif

include/macro.F90

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include "language-support.F90"
2+
implicit none
3+
4+
#if (GCC_VERSION > 140200)
5+
print *,"(GCC_VERSION > 140200)"
6+
#else
7+
print *,"! (GCC_VERSION > 140200)"
8+
#endif
9+
10+
end

0 commit comments

Comments
 (0)