gbranden pushed a commit to branch master
in repository groff.

commit 12c20a5bfe663c8121b06a636c108a683305129d
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Apr 12 01:18:47 2026 -0500

    src/libs/libdriver/printer.cpp: Favor C++ idiom.
    
    ...over that of C.
    
    * src/libs/libdriver/printer.cpp: Favor idiomatic C++ over C
      preprocessor hacks.
    
      (check_for_output_error)
      [!(_MSC_VER || _WIN32 && !__CYGWIN && !__UWIN)]: Define as a `static
      inline` function, not a preprocessor macro.
---
 ChangeLog                      | 8 ++++++++
 src/libs/libdriver/printer.cpp | 5 ++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index aa6addd0a..d6ce2b004 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2026-04-12  G. Branden Robinson <[email protected]>
+
+       * src/libs/libdriver/printer.cpp: Favor idiomatic C++ over C
+       preprocessor hacks.
+       (check_for_output_error)
+       [!(_MSC_VER || _WIN32 && !__CYGWIN && !__UWIN)]: Define as a
+       `static inline` function, not a preprocessor macro.
+
 2026-04-12  G. Branden Robinson <[email protected]>
 
        [troff]: The `phw` request now accepts arguments.  Each is
diff --git a/src/libs/libdriver/printer.cpp b/src/libs/libdriver/printer.cpp
index 61ff3683f..ecfe965ee 100644
--- a/src/libs/libdriver/printer.cpp
+++ b/src/libs/libdriver/printer.cpp
@@ -79,7 +79,10 @@ with this program.  If not, see 
<http://www.gnu.org/licenses/>.
   /* For other systems, we simply assume that *any* output error context
      is to be reported.
   */
-# define check_for_output_error(stream) ferror(stream) || fflush(stream) < 0
+  static inline int check_for_output_error(FILE* stream)
+  {
+    return (ferror(stream) || (fflush(stream) < 0));
+  }
 
 #endif
 

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to