1414include ' ../include/flang/Runtime/magic-numbers.h'
1515
1616module __fortran_ieee_exceptions
17+ implicit none
1718
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
1924 private
2025 integer (kind= 1 ) :: flag = 0
2126 end type ieee_flag_type
2227
23- type (ieee_flag_type), parameter :: &
28+ type (ieee_flag_type), parameter , public :: &
2429 ieee_invalid = ieee_flag_type(_FORTRAN_RUNTIME_IEEE_INVALID), &
2530 ieee_overflow = ieee_flag_type(_FORTRAN_RUNTIME_IEEE_OVERFLOW), &
2631 ieee_divide_by_zero = &
2934 ieee_inexact = ieee_flag_type(_FORTRAN_RUNTIME_IEEE_INEXACT), &
3035 ieee_denorm = ieee_flag_type(_FORTRAN_RUNTIME_IEEE_DENORM) ! extension
3136
32- type (ieee_flag_type), parameter :: &
37+ type (ieee_flag_type), parameter , public :: &
3338 ieee_usual(* ) = [ ieee_overflow, ieee_divide_by_zero, ieee_invalid ], &
3439 ieee_all(* ) = [ ieee_usual, ieee_underflow, ieee_inexact ]
3540
36- type :: ieee_modes_type ! Fortran 2018, 17.7
41+ type, public :: ieee_modes_type ! Fortran 2018, 17.7
3742 private ! opaque fenv.h femode_t data
3843 integer (kind= 4 ) :: __data(_FORTRAN_RUNTIME_IEEE_FEMODE_T_EXTENT)
3944 end type ieee_modes_type
4045
41- type :: ieee_status_type ! Fortran 2018, 17.7
46+ type, public :: ieee_status_type ! Fortran 2018, 17.7
4247 private ! opaque fenv.h fenv_t data
4348 integer (kind= 4 ) :: __data(_FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT)
4449 end type ieee_status_type
5459 G(2 ) G(3 ) G(4 ) G(8 ) G(16 )
5560#endif
5661
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-
6962#define IEEE_GET_FLAG_L(FVKIND) \
7063 elemental subroutine ieee_get_flag_l ##FVKIND(flag, flag_value); \
7164 import ieee_flag_type; \
@@ -75,7 +68,7 @@ end subroutine ieee_get_flag_l##FVKIND;
7568 interface ieee_get_flag
7669 SPECIFICS_L(IEEE_GET_FLAG_L)
7770 end interface ieee_get_flag
78- PRIVATE_L(IEEE_GET_FLAG)
71+ public :: ieee_get_flag
7972#undef IEEE_GET_FLAG_L
8073
8174#define IEEE_GET_HALTING_MODE_L(HKIND) \
@@ -87,7 +80,7 @@ end subroutine ieee_get_halting_mode_l##HKIND;
8780 interface ieee_get_halting_mode
8881 SPECIFICS_L(IEEE_GET_HALTING_MODE_L)
8982 end interface ieee_get_halting_mode
90- PRIVATE_L(IEEE_GET_HALTING_MODE)
83+ public :: ieee_get_halting_mode
9184#undef IEEE_GET_HALTING_MODE_L
9285
9386 interface ieee_get_modes
@@ -96,13 +89,15 @@ pure subroutine ieee_get_modes_0(modes)
9689 type (ieee_modes_type), intent (out ) :: modes
9790 end subroutine ieee_get_modes_0
9891 end interface
92+ public :: ieee_get_modes
9993
10094 interface ieee_get_status
10195 pure subroutine ieee_get_status_0 (status )
10296 import ieee_status_type
10397 type (ieee_status_type), intent (out ) :: status
10498 end subroutine ieee_get_status_0
10599 end interface
100+ public :: ieee_get_status
106101
107102#define IEEE_SET_FLAG_L(FVKIND) \
108103 elemental subroutine ieee_set_flag_l ##FVKIND(flag, flag_value); \
@@ -113,7 +108,7 @@ end subroutine ieee_set_flag_l##FVKIND;
113108 interface ieee_set_flag
114109 SPECIFICS_L(IEEE_SET_FLAG_L)
115110 end interface ieee_set_flag
116- PRIVATE_L(IEEE_SET_FLAG)
111+ public :: ieee_set_flag
117112#undef IEEE_SET_FLAG_L
118113
119114#define IEEE_SET_HALTING_MODE_L(HKIND) \
@@ -125,7 +120,7 @@ end subroutine ieee_set_halting_mode_l##HKIND;
125120 interface ieee_set_halting_mode
126121 SPECIFICS_L(IEEE_SET_HALTING_MODE_L)
127122 end interface ieee_set_halting_mode
128- PRIVATE_L(IEEE_SET_HALTING_MODE)
123+ public :: ieee_set_halting_mode
129124#undef IEEE_SET_HALTING_MODE_L
130125
131126 interface ieee_set_modes
@@ -134,13 +129,15 @@ subroutine ieee_set_modes_0(modes)
134129 type (ieee_modes_type), intent (in ) :: modes
135130 end subroutine ieee_set_modes_0
136131 end interface
132+ public :: ieee_set_modes
137133
138134 interface ieee_set_status
139135 subroutine ieee_set_status_0 (status )
140136 import ieee_status_type
141137 type (ieee_status_type), intent (in ) :: status
142138 end subroutine ieee_set_status_0
143139 end interface
140+ public :: ieee_set_status
144141
145142#define IEEE_SUPPORT_FLAG_R(XKIND) \
146143 pure logical function ieee_support_flag_a##XKIND(flag, x); \
@@ -155,7 +152,7 @@ pure logical function ieee_support_flag_0(flag)
155152 end function ieee_support_flag_0
156153 SPECIFICS_R(IEEE_SUPPORT_FLAG_R)
157154 end interface ieee_support_flag
158- PRIVATE_R(IEEE_SUPPORT_FLAG)
155+ public :: ieee_support_flag
159156#undef IEEE_SUPPORT_FLAG_R
160157
161158 interface ieee_support_halting
@@ -164,5 +161,6 @@ pure logical function ieee_support_halting_0(flag)
164161 type (ieee_flag_type), intent (in ) :: flag
165162 end function ieee_support_halting_0
166163 end interface
164+ public :: ieee_support_halting
167165
168166end module __fortran_ieee_exceptions
0 commit comments