Skip to content

Commit

Permalink
Hack for Intel compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
zoziha committed Feb 2, 2023
1 parent 0c958dd commit fe23cc0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/argparse-f.f90
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ module argparse
subroutine sc_option_callback
end subroutine sc_option_callback
end interface
!> Hack for Intel Fortran
procedure(sc_option_callback), pointer :: dummy_print_help_wrapper => dummy_print_help

type short_circuit_option
character(len=short_name_len) :: short_name
Expand Down Expand Up @@ -169,7 +171,7 @@ subroutine argp_parse(this)
do j = 1, argc
tok = tokens(j)
if (tok == this%sc_options(i)%short_name .or. tok == this%sc_options(i)%long_name) then
if (associated(this%sc_options(i)%callback, dummy_print_help)) then
if (associated(this%sc_options(i)%callback, dummy_print_help_wrapper)) then
call this%print_help()
else
call this%sc_options(i)%callback()
Expand Down Expand Up @@ -215,7 +217,7 @@ subroutine argp_parse(this)
idx = this%short_name_index(ichar(tok(i:i)))
! short circuit option
if (idx <= this%sc_option_size .and. this%sc_options(idx)%short_name(2:2) == tok(i:i)) then
if (associated(this%sc_options(idx)%callback, dummy_print_help)) then
if (associated(this%sc_options(idx)%callback, dummy_print_help_wrapper)) then
call this%print_help()
else
call this%sc_options(idx)%callback()
Expand Down

0 comments on commit fe23cc0

Please sign in to comment.