Skip to content

Commit ea2ee72

Browse files
committed
add fypp directives for qp
1 parent a3df7b6 commit ea2ee72

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/stdlib_str2num.fypp

+12-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
!> difference rel : 0.3300E-029%
2323

2424
module stdlib_str2num
25-
use iso_fortran_env, only: sp => real32, dp => real64, qp => real128
25+
use stdlib_kinds, only: sp, dp, qp, int8, int32
2626
use ieee_arithmetic
2727
implicit none
2828
private
@@ -46,21 +46,27 @@ module stdlib_str2num
4646
module procedure to_int
4747
module procedure to_float
4848
module procedure to_double
49+
#:if WITH_QP
4950
module procedure to_quad
51+
#:endif
5052
end interface
5153

5254
interface to_num_p
5355
module procedure to_int_p
5456
module procedure to_float_p
5557
module procedure to_double_p
58+
#:if WITH_QP
5659
module procedure to_quad_p
60+
#:endif
5761
end interface
5862

5963
interface to_num_base
6064
module procedure to_int_32
6165
module procedure to_real_sp
6266
module procedure to_real_dp
67+
#:if WITH_QP
6368
module procedure to_real_qp
69+
#:endif
6470
end interface
6571

6672
contains
@@ -153,6 +159,7 @@ module stdlib_str2num
153159
if(present(stat)) stat = err
154160
end function
155161

162+
#:if WITH_QP
156163
function to_quad(s,mold) result(r)
157164
! -- In/out Variables
158165
character(*), intent(in) :: s !> input string
@@ -180,6 +187,7 @@ module stdlib_str2num
180187
s => s(p:)
181188
if(present(stat)) stat = err
182189
end function
190+
#:endif
183191

184192
!---------------------------------------------
185193
! String To Number Implementations
@@ -400,6 +408,7 @@ module stdlib_str2num
400408
stat = 0
401409
end subroutine
402410

411+
#:if WITH_QP
403412
subroutine to_real_qp(s,v,p,stat)
404413
integer, parameter :: wp = qp
405414
!> Sequentially unroll the character and get the sub integers composing the whole number, fraction and exponent
@@ -502,6 +511,7 @@ module stdlib_str2num
502511
end if
503512
stat = 0
504513
end subroutine
514+
#:endif
505515

506516
!---------------------------------------------
507517
! Internal Utility functions
@@ -529,4 +539,4 @@ module stdlib_str2num
529539
end do
530540
end function
531541

532-
end module stdlib_str2num
542+
end module stdlib_str2num

0 commit comments

Comments
 (0)