@@ -28,7 +28,7 @@ RT_API_ATTRS OwningPtr<char> SaveDefaultCharacter(
2828 const char *s, std::size_t length, const Terminator &terminator) {
2929 if (s) {
3030 auto *p{static_cast <char *>(AllocateMemoryOrCrash (terminator, length + 1 ))};
31- std ::memcpy (p, s, length);
31+ Fortran::runtime ::memcpy (p, s, length);
3232 p[length] = ' \0 ' ;
3333 return OwningPtr<char >{p};
3434 } else {
@@ -75,10 +75,10 @@ RT_API_ATTRS void ToFortranDefaultCharacter(
7575 char *to, std::size_t toLength, const char *from) {
7676 std::size_t len{Fortran::runtime::strlen (from)};
7777 if (len < toLength) {
78- std ::memcpy (to, from, len);
79- std ::memset (to + len, ' ' , toLength - len);
78+ Fortran::runtime ::memcpy (to, from, len);
79+ Fortran::runtime ::memset (to + len, ' ' , toLength - len);
8080 } else {
81- std ::memcpy (to, from, toLength);
81+ Fortran::runtime ::memcpy (to, from, toLength);
8282 }
8383}
8484
@@ -122,7 +122,7 @@ RT_API_ATTRS void ShallowCopyDiscontiguousToDiscontiguous(
122122 std::size_t elementBytes{to.ElementBytes ()};
123123 for (std::size_t n{to.Elements ()}; n-- > 0 ;
124124 to.IncrementSubscripts (toAt), from.IncrementSubscripts (fromAt)) {
125- std ::memcpy (
125+ Fortran::runtime ::memcpy (
126126 to.Element <char >(toAt), from.Element <char >(fromAt), elementBytes);
127127 }
128128}
@@ -135,7 +135,7 @@ RT_API_ATTRS void ShallowCopyDiscontiguousToContiguous(
135135 std::size_t elementBytes{to.ElementBytes ()};
136136 for (std::size_t n{to.Elements ()}; n-- > 0 ;
137137 toAt += elementBytes, from.IncrementSubscripts (fromAt)) {
138- std ::memcpy (toAt, from.Element <char >(fromAt), elementBytes);
138+ Fortran::runtime ::memcpy (toAt, from.Element <char >(fromAt), elementBytes);
139139 }
140140}
141141
@@ -147,15 +147,15 @@ RT_API_ATTRS void ShallowCopyContiguousToDiscontiguous(
147147 std::size_t elementBytes{to.ElementBytes ()};
148148 for (std::size_t n{to.Elements ()}; n-- > 0 ;
149149 to.IncrementSubscripts (toAt), fromAt += elementBytes) {
150- std ::memcpy (to.Element <char >(toAt), fromAt, elementBytes);
150+ Fortran::runtime ::memcpy (to.Element <char >(toAt), fromAt, elementBytes);
151151 }
152152}
153153
154154RT_API_ATTRS void ShallowCopy (const Descriptor &to, const Descriptor &from,
155155 bool toIsContiguous, bool fromIsContiguous) {
156156 if (toIsContiguous) {
157157 if (fromIsContiguous) {
158- std ::memcpy (to.OffsetElement (), from.OffsetElement (),
158+ Fortran::runtime ::memcpy (to.OffsetElement (), from.OffsetElement (),
159159 to.Elements () * to.ElementBytes ());
160160 } else {
161161 ShallowCopyDiscontiguousToContiguous (to, from);
@@ -177,7 +177,7 @@ RT_API_ATTRS char *EnsureNullTerminated(
177177 char *str, std::size_t length, Terminator &terminator) {
178178 if (runtime::memchr (str, ' \0 ' , length) == nullptr ) {
179179 char *newCmd{(char *)AllocateMemoryOrCrash (terminator, length + 1 )};
180- std ::memcpy (newCmd, str, length);
180+ Fortran::runtime ::memcpy (newCmd, str, length);
181181 newCmd[length] = ' \0 ' ;
182182 return newCmd;
183183 } else {
@@ -209,7 +209,7 @@ RT_API_ATTRS std::int32_t CopyCharsToDescriptor(const Descriptor &value,
209209 return ToErrmsg (errmsg, StatValueTooShort);
210210 }
211211
212- std ::memcpy (value.OffsetElement (offset), rawValue, toCopy);
212+ Fortran::runtime ::memcpy (value.OffsetElement (offset), rawValue, toCopy);
213213
214214 if (static_cast <std::int64_t >(rawValueLength) > toCopy) {
215215 return ToErrmsg (errmsg, StatValueTooShort);
0 commit comments