void-packages/srcpkgs/libreoffice/patches/no-fsword_t.patch
2024-04-18 07:28:25 +07:00

40 lines
1.4 KiB
Diff

From 434065478d35fe8e144aec916ac06438c0150270 Mon Sep 17 00:00:00 2001
From: Stephan Bergmann <stephan.bergmann@allotropia.de>
Date: Fri, 8 Mar 2024 12:47:23 +0100
Subject: [PATCH] Avoid mentioning Glibc-internal type __fsword_t
...and clean up the use of macros here
Change-Id: Iede9ff705992d5e229b44b48cd88f5b495f6cee4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164571
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
---
sal/osl/unx/file.cxx | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index 5c4069cae2de4..b15fe963605fd 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -39,6 +39,7 @@
#include <fcntl.h>
#include <limits>
#include <limits.h>
+#include <utility>
#include <string.h>
#include <pthread.h>
@@ -67,9 +68,9 @@
#ifdef LINUX
#include <sys/vfs.h>
// As documented by the kernel
-#define SMB_SUPER_MAGIC static_cast<__fsword_t>(0x517B)
-#define CIFS_SUPER_MAGIC static_cast<__fsword_t>(0xFF534D42)
-#define SMB2_SUPER_MAGIC static_cast<__fsword_t>(0xFE534D42)
+constexpr decltype(std::declval<struct statfs>().f_type) SMB_SUPER_MAGIC = 0x517B;
+constexpr decltype(std::declval<struct statfs>().f_type) CIFS_SUPER_MAGIC = 0xFF534D42;
+constexpr decltype(std::declval<struct statfs>().f_type) SMB2_SUPER_MAGIC = 0xFE534D42;
#endif
namespace {