@@ -220,7 +220,11 @@ ExternalIoStatementBase::ExternalIoStatementBase(
220
220
221
221
MutableModes &ExternalIoStatementBase::mutableModes () {
222
222
if (const ChildIo * child{unit_.GetChildIo ()}) {
223
+ #if !defined(RT_DEVICE_AVOID_RECURSION)
223
224
return child->parent ().mutableModes ();
225
+ #else
226
+ ReportUnsupportedChildIo ();
227
+ #endif
224
228
}
225
229
return unit_.modes ;
226
230
}
@@ -891,17 +895,29 @@ ChildIoStatementState<DIR>::ChildIoStatementState(
891
895
892
896
template <Direction DIR>
893
897
MutableModes &ChildIoStatementState<DIR>::mutableModes() {
898
+ #if !defined(RT_DEVICE_AVOID_RECURSION)
894
899
return child_.parent ().mutableModes ();
900
+ #else
901
+ ReportUnsupportedChildIo ();
902
+ #endif
895
903
}
896
904
897
905
template <Direction DIR>
898
906
ConnectionState &ChildIoStatementState<DIR>::GetConnectionState() {
907
+ #if !defined(RT_DEVICE_AVOID_RECURSION)
899
908
return child_.parent ().GetConnectionState ();
909
+ #else
910
+ ReportUnsupportedChildIo ();
911
+ #endif
900
912
}
901
913
902
914
template <Direction DIR>
903
915
ExternalFileUnit *ChildIoStatementState<DIR>::GetExternalFileUnit() const {
916
+ #if !defined(RT_DEVICE_AVOID_RECURSION)
904
917
return child_.parent ().GetExternalFileUnit ();
918
+ #else
919
+ ReportUnsupportedChildIo ();
920
+ #endif
905
921
}
906
922
907
923
template <Direction DIR> int ChildIoStatementState<DIR>::EndIoStatement() {
@@ -914,22 +930,38 @@ template <Direction DIR> int ChildIoStatementState<DIR>::EndIoStatement() {
914
930
template <Direction DIR>
915
931
bool ChildIoStatementState<DIR>::Emit(
916
932
const char *data, std::size_t bytes, std::size_t elementBytes) {
933
+ #if !defined(RT_DEVICE_AVOID_RECURSION)
917
934
return child_.parent ().Emit (data, bytes, elementBytes);
935
+ #else
936
+ ReportUnsupportedChildIo ();
937
+ #endif
918
938
}
919
939
920
940
template <Direction DIR>
921
941
std::size_t ChildIoStatementState<DIR>::GetNextInputBytes(const char *&p) {
942
+ #if !defined(RT_DEVICE_AVOID_RECURSION)
922
943
return child_.parent ().GetNextInputBytes (p);
944
+ #else
945
+ ReportUnsupportedChildIo ();
946
+ #endif
923
947
}
924
948
925
949
template <Direction DIR>
926
950
void ChildIoStatementState<DIR>::HandleAbsolutePosition(std::int64_t n) {
951
+ #if !defined(RT_DEVICE_AVOID_RECURSION)
927
952
return child_.parent ().HandleAbsolutePosition (n);
953
+ #else
954
+ ReportUnsupportedChildIo ();
955
+ #endif
928
956
}
929
957
930
958
template <Direction DIR>
931
959
void ChildIoStatementState<DIR>::HandleRelativePosition(std::int64_t n) {
960
+ #if !defined(RT_DEVICE_AVOID_RECURSION)
932
961
return child_.parent ().HandleRelativePosition (n);
962
+ #else
963
+ ReportUnsupportedChildIo ();
964
+ #endif
933
965
}
934
966
935
967
template <Direction DIR, typename CHAR>
@@ -957,13 +989,21 @@ int ChildFormattedIoStatementState<DIR, CHAR>::EndIoStatement() {
957
989
958
990
template <Direction DIR, typename CHAR>
959
991
bool ChildFormattedIoStatementState<DIR, CHAR>::AdvanceRecord(int n) {
992
+ #if !defined(RT_DEVICE_AVOID_RECURSION)
960
993
return this ->child ().parent ().AdvanceRecord (n);
994
+ #else
995
+ this ->ReportUnsupportedChildIo ();
996
+ #endif
961
997
}
962
998
963
999
template <Direction DIR>
964
1000
bool ChildUnformattedIoStatementState<DIR>::Receive(
965
1001
char *data, std::size_t bytes, std::size_t elementBytes) {
1002
+ #if !defined(RT_DEVICE_AVOID_RECURSION)
966
1003
return this ->child ().parent ().Receive (data, bytes, elementBytes);
1004
+ #else
1005
+ this ->ReportUnsupportedChildIo ();
1006
+ #endif
967
1007
}
968
1008
969
1009
template <Direction DIR> int ChildListIoStatementState<DIR>::EndIoStatement() {
0 commit comments