Skip to content

Commit

Permalink
New way of handling fckit_external and fckit_owned.
Browse files Browse the repository at this point in the history
  • Loading branch information
DJDavies2 committed Jun 14, 2024
1 parent 4b244a6 commit 2d681b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
12 changes: 4 additions & 8 deletions src/fckit/module/fckit_refcount.F90
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,10 @@ subroutine allocate_fckit_external(refcount,shared_ptr)
FCKIT_SUPPRESS_UNUSED( shared_ptr )
end subroutine

#ifndef NAG
function fckit_external() result(funptr)
subroutine fckit_external (funptr)
procedure(fckit_refcount_interface), pointer :: funptr
funptr => allocate_fckit_external
end function
#endif
end subroutine fckit_external

#if FCKIT_HAVE_ECKIT
subroutine allocate_fckit_refcount_owned(refcount,shared_ptr)
Expand All @@ -142,12 +140,10 @@ subroutine allocate_fckit_refcount_owned(refcount,shared_ptr)
end select
end subroutine

#ifndef NAG
function fckit_owned() result(funptr)
subroutine fckit_owned(funptr)
procedure(fckit_refcount_interface), pointer :: funptr
funptr => allocate_fckit_refcount_owned
end function
#endif
end subroutine fckit_owned

#endif

Expand Down
4 changes: 1 addition & 3 deletions src/fckit/module/fckit_shared_ptr.F90
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,7 @@ subroutine share( this, ptr, refcount )
if( present(refcount) ) then
call c_f_procpointer( refcount, opt_refcount )
else
#ifndef NAG
opt_refcount => fckit_external()
#endif
call fckit_external(opt_refcount)
endif
this%shared_ptr_ => ptr
this%is_null_ = .not. associated( this%shared_ptr_ )
Expand Down

0 comments on commit 2d681b9

Please sign in to comment.