Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/json_string_utilities.F90
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,12 @@ end subroutine string_to_real

subroutine string_to_real_c(str,use_quiet_nan,rval,status_ok)

use iso_c_binding, only: c_double, c_float, c_long_double, &
use iso_c_binding, only: c_double, c_float, &
c_char, c_ptr, c_null_ptr, c_long, &
c_null_char, c_loc, c_associated

#ifdef REAL128
use iso_c_binding, only: c_long_double
#endif
implicit none

character(kind=CK,len=*),intent(in) :: str !! the string to convert to a real
Expand All @@ -290,24 +292,29 @@ subroutine string_to_real_c(str,use_quiet_nan,rval,status_ok)
function strtof( str, endptr ) result(d) bind(C, name="strtof" )
!! <stdlib.h> :: float strtof(const char *str, char **endptr)
import
implicit none
character(kind=c_char,len=1),dimension(*),intent(in) :: str
type(c_ptr), intent(inout) :: endptr
real(c_float) :: d
end function strtof
function strtod( str, endptr ) result(d) bind(C, name="strtod" )
!! <stdlib.h> :: double strtod(const char *str, char **endptr)
import
implicit none
character(kind=c_char,len=1),dimension(*),intent(in) :: str
type(c_ptr), intent(inout) :: endptr
real(c_double) :: d
end function strtod
#ifdef REAL128
function strtold( str, endptr ) result(d) bind(C, name="strtold" )
!! <stdlib.h> :: long double strtold(const char *str, char **endptr)
import
implicit none
character(kind=c_char,len=1),dimension(*),intent(in) :: str
type(c_ptr), intent(inout) :: endptr
real(c_long_double) :: d
end function strtold
#endif
end interface

#ifdef USE_UCS4
Expand Down