]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR modula2/123151: Unable to use IsNoError with Close in FIO library module
authorGaius Mulley <gaiusmod2@gmail.com>
Wed, 17 Dec 2025 13:00:33 +0000 (13:00 +0000)
committerGaius Mulley <gaiusmod2@gmail.com>
Wed, 17 Dec 2025 13:00:33 +0000 (13:00 +0000)
commit84ad0d86df69b3c1b5970efa490eeafc5266802a
tree1d8c31eb697b1aec48c4995cfb6f2221ec943394
parentbd986ddbded2cfcbe3ccdc076e4cba15a7643b65
PR modula2/123151: Unable to use IsNoError with Close in FIO library module

This is a bug fix to the library module FIO to allow Close to return a
boolean indicating success.  Most probably in the future there should be
a GetStatus procedure provided and the FileStatus enumeration inside
FIO.mod should also be exported.

gcc/m2/ChangeLog:

PR modula2/123151
* gm2-libs/FIO.def (IsError): New procedure function.
(IsActive): Rewrite the comment.
(Exists): Ditto.
(OpenToRead): Ditto.
(OpenToWrite): Ditto.
(Close): Add an optional BOOLEAN return result.
* gm2-libs/FIO.mod (Close): Reimplement with an
optional BOOLEAN return result.

gcc/testsuite/ChangeLog:

PR modula2/123151
* gm2/pimlib/base/run/pass/FIO.mod: Reimplement.
Copy from gm2-libs/FIO.mod since FIO.def api has changed.
* gm2/pimlib/run/pass/testclose.mod: New test.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
gcc/m2/gm2-libs/FIO.def
gcc/m2/gm2-libs/FIO.mod
gcc/testsuite/gm2/pimlib/base/run/pass/FIO.mod
gcc/testsuite/gm2/pimlib/run/pass/testclose.mod [new file with mode: 0644]