14
14
include ' ../include/flang/Runtime/magic-numbers.h'
15
15
16
16
module __fortran_ieee_exceptions
17
+ implicit none
17
18
18
- type :: ieee_flag_type ! Fortran 2018, 17.2 & 17.3
19
+ ! Set PRIVATE by default to explicitly only export what is meant
20
+ ! to be exported by this MODULE.
21
+ private
22
+
23
+ type, public :: ieee_flag_type ! Fortran 2018, 17.2 & 17.3
19
24
private
20
25
integer (kind= 1 ) :: flag = 0
21
26
end type ieee_flag_type
22
27
23
- type (ieee_flag_type), parameter :: &
28
+ type (ieee_flag_type), parameter , public :: &
24
29
ieee_invalid = ieee_flag_type(_FORTRAN_RUNTIME_IEEE_INVALID), &
25
30
ieee_overflow = ieee_flag_type(_FORTRAN_RUNTIME_IEEE_OVERFLOW), &
26
31
ieee_divide_by_zero = &
29
34
ieee_inexact = ieee_flag_type(_FORTRAN_RUNTIME_IEEE_INEXACT), &
30
35
ieee_denorm = ieee_flag_type(_FORTRAN_RUNTIME_IEEE_DENORM) ! extension
31
36
32
- type (ieee_flag_type), parameter :: &
37
+ type (ieee_flag_type), parameter , public :: &
33
38
ieee_usual(* ) = [ ieee_overflow, ieee_divide_by_zero, ieee_invalid ], &
34
39
ieee_all(* ) = [ ieee_usual, ieee_underflow, ieee_inexact ]
35
40
36
- type :: ieee_modes_type ! Fortran 2018, 17.7
41
+ type, public :: ieee_modes_type ! Fortran 2018, 17.7
37
42
private ! opaque fenv.h femode_t data
38
43
integer (kind= 4 ) :: __data(_FORTRAN_RUNTIME_IEEE_FEMODE_T_EXTENT)
39
44
end type ieee_modes_type
40
45
41
- type :: ieee_status_type ! Fortran 2018, 17.7
46
+ type, public :: ieee_status_type ! Fortran 2018, 17.7
42
47
private ! opaque fenv.h fenv_t data
43
48
integer (kind= 4 ) :: __data(_FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT)
44
49
end type ieee_status_type
54
59
G(2 ) G(3 ) G(4 ) G(8 ) G(16 )
55
60
#endif
56
61
57
- ! Set PRIVATE accessibility for specifics with 1 LOGICAL or REAL argument for
58
- ! generic G.
59
- #define PRIVATE_L(G) private :: \
60
- G##_l1, G##_l2, G##_l4, G##_l8
61
- #if __x86_64__
62
- #define PRIVATE_R(G) private :: \
63
- G##_a2, G##_a3, G##_a4, G##_a8, G##_a10, G##_a16
64
- #else
65
- #define PRIVATE_R(G) private :: \
66
- G##_a2, G##_a3, G##_a4, G##_a8, G##_a16
67
- #endif
68
-
69
62
#define IEEE_GET_FLAG_L(FVKIND) \
70
63
elemental subroutine ieee_get_flag_l ##FVKIND(flag, flag_value); \
71
64
import ieee_flag_type; \
@@ -75,7 +68,7 @@ end subroutine ieee_get_flag_l##FVKIND;
75
68
interface ieee_get_flag
76
69
SPECIFICS_L(IEEE_GET_FLAG_L)
77
70
end interface ieee_get_flag
78
- PRIVATE_L(IEEE_GET_FLAG)
71
+ public :: ieee_get_flag
79
72
#undef IEEE_GET_FLAG_L
80
73
81
74
#define IEEE_GET_HALTING_MODE_L(HKIND) \
@@ -87,7 +80,7 @@ end subroutine ieee_get_halting_mode_l##HKIND;
87
80
interface ieee_get_halting_mode
88
81
SPECIFICS_L(IEEE_GET_HALTING_MODE_L)
89
82
end interface ieee_get_halting_mode
90
- PRIVATE_L(IEEE_GET_HALTING_MODE)
83
+ public :: ieee_get_halting_mode
91
84
#undef IEEE_GET_HALTING_MODE_L
92
85
93
86
interface ieee_get_modes
@@ -96,13 +89,15 @@ pure subroutine ieee_get_modes_0(modes)
96
89
type (ieee_modes_type), intent (out ) :: modes
97
90
end subroutine ieee_get_modes_0
98
91
end interface
92
+ public :: ieee_get_modes
99
93
100
94
interface ieee_get_status
101
95
pure subroutine ieee_get_status_0 (status )
102
96
import ieee_status_type
103
97
type (ieee_status_type), intent (out ) :: status
104
98
end subroutine ieee_get_status_0
105
99
end interface
100
+ public :: ieee_get_status
106
101
107
102
#define IEEE_SET_FLAG_L(FVKIND) \
108
103
elemental subroutine ieee_set_flag_l ##FVKIND(flag, flag_value); \
@@ -113,7 +108,7 @@ end subroutine ieee_set_flag_l##FVKIND;
113
108
interface ieee_set_flag
114
109
SPECIFICS_L(IEEE_SET_FLAG_L)
115
110
end interface ieee_set_flag
116
- PRIVATE_L(IEEE_SET_FLAG)
111
+ public :: ieee_set_flag
117
112
#undef IEEE_SET_FLAG_L
118
113
119
114
#define IEEE_SET_HALTING_MODE_L(HKIND) \
@@ -125,7 +120,7 @@ end subroutine ieee_set_halting_mode_l##HKIND;
125
120
interface ieee_set_halting_mode
126
121
SPECIFICS_L(IEEE_SET_HALTING_MODE_L)
127
122
end interface ieee_set_halting_mode
128
- PRIVATE_L(IEEE_SET_HALTING_MODE)
123
+ public :: ieee_set_halting_mode
129
124
#undef IEEE_SET_HALTING_MODE_L
130
125
131
126
interface ieee_set_modes
@@ -134,13 +129,15 @@ subroutine ieee_set_modes_0(modes)
134
129
type (ieee_modes_type), intent (in ) :: modes
135
130
end subroutine ieee_set_modes_0
136
131
end interface
132
+ public :: ieee_set_modes
137
133
138
134
interface ieee_set_status
139
135
subroutine ieee_set_status_0 (status )
140
136
import ieee_status_type
141
137
type (ieee_status_type), intent (in ) :: status
142
138
end subroutine ieee_set_status_0
143
139
end interface
140
+ public :: ieee_set_status
144
141
145
142
#define IEEE_SUPPORT_FLAG_R(XKIND) \
146
143
pure logical function ieee_support_flag_a##XKIND(flag, x); \
@@ -155,7 +152,7 @@ pure logical function ieee_support_flag_0(flag)
155
152
end function ieee_support_flag_0
156
153
SPECIFICS_R(IEEE_SUPPORT_FLAG_R)
157
154
end interface ieee_support_flag
158
- PRIVATE_R(IEEE_SUPPORT_FLAG)
155
+ public :: ieee_support_flag
159
156
#undef IEEE_SUPPORT_FLAG_R
160
157
161
158
interface ieee_support_halting
@@ -164,5 +161,6 @@ pure logical function ieee_support_halting_0(flag)
164
161
type (ieee_flag_type), intent (in ) :: flag
165
162
end function ieee_support_halting_0
166
163
end interface
164
+ public :: ieee_support_halting
167
165
168
166
end module __fortran_ieee_exceptions
0 commit comments