include/tools/UnixWrappers.h |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 36e4a4329a39a362403c7c9bfd2f1a7fbe05eee6
Author:     Tor Lillqvist <[email protected]>
AuthorDate: Wed Jan 7 15:18:50 2026 +0200
Commit:     Tor Lillqvist <[email protected]>
CommitDate: Thu Jan 8 11:45:21 2026 +0100

    Make <tools/UnixWrappers.h> more robust
    
    Surround with a multiple inclusion guard, and use the modern C++
    [[maybe_unused]] thing only when available.
    
    Change-Id: Id1eebd65edb6846d1551b56e208917c2c1f6b34d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196681
    Tested-by: Tor Lillqvist <[email protected]>
    Reviewed-by: Tor Lillqvist <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/include/tools/UnixWrappers.h b/include/tools/UnixWrappers.h
index bf4e58a17090..dc1c2becd509 100644
--- a/include/tools/UnixWrappers.h
+++ b/include/tools/UnixWrappers.h
@@ -32,6 +32,9 @@
  * All functions behave like the wrapped ones, set errno on errors.
  */
 
+#ifndef INCLUDED_TOOLS_UNIXWRAPPERS_H
+#define INCLUDED_TOOLS_UNIXWRAPPERS_H
+
 #include <fcntl.h>
 #include <stdint.h>
 #include <stdio.h>
@@ -74,7 +77,7 @@ extern "C" {
 
 #endif
 
-#ifdef __cplusplus
+#if defined __cplusplus && __cplusplus >= 201703L
 #define UNIXWRAPPERS_H_MAYBE_UNUSED [[maybe_unused]]
 #else
 #define UNIXWRAPPERS_H_MAYBE_UNUSED
@@ -333,4 +336,6 @@ UNIXWRAPPERS_H_MAYBE_UNUSED static const char* 
wrap_realpath(const char* path, c
 
 #undef UNIXWRAPPERS_H_MAYBE_UNUSED
 
+#endif
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */

Reply via email to