Skip to content

Commit 685fb85

Browse files
committed
Gaurd new descriptor component w/ ifdef GCC >= 8
1 parent 5f35ba7 commit 685fb85

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ endif()
165165
if ( gfortran_compiler AND ( NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0 ) )
166166
add_definitions(-DGCC_GE_7) # Tell library to build against GFortran 7.x bindings b/c we might be using clang for C
167167
endif()
168+
if ( gfortran_compiler AND ( NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 8.0.0 ) )
169+
add_definitions(-DGCC_GE_8) # Tell library to build against GFortran 8.x bindings w/ descriptor change
170+
endif()
168171

169172
if(gfortran_compiler)
170173
set(OLD_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})

src/libcaf-gfortran-descriptor.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ typedef struct gfc_descriptor_t {
5151
void *base_addr;
5252
size_t offset;
5353
ptrdiff_t dtype;
54+
#ifdef GCC_GE_8
5455
ptrdiff_t span;
56+
#endif
5557
descriptor_dimension dim[];
5658
} gfc_descriptor_t;
5759

0 commit comments

Comments
 (0)