Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/VLC/contrib/src/nfs/   (VLC Media Plyer ©)  Datei vom 23.9.2026 mit Größe 1 kB image not shown  

Quelle  0004-win32-fix-build-with-MSVC.patch  Sprache: unbekannt

 
Spracherkennung für: .patch vermutete Sprache: Abap {ABAP[44] Masm[36] Apollo[30]} [Methode: maximale Elemente, drei Dimensionen]

From 7f4d51641ae8383d51779f104ae4f7ba121b75f6 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Mon, 16 Dec 2024 10:06:20 +0100
Subject: [PATCH 4/5] win32: fix build with MSVC

strndup doesn't exist, but there's a compat version for that.
---
 include/win32/win32_compat.h | 2 +-
 lib/nfs_v4.c                 | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/win32/win32_compat.h b/include/win32/win32_compat.h
index e11bf70..09f8eb1 100755
--- a/include/win32/win32_compat.h
+++ b/include/win32/win32_compat.h
@@ -163,7 +163,7 @@ int     win32_gettimeofday(struct timeval *tv, struct timezone *tz);
 
 #define DllExport
 
-#ifdef __MINGW32__
+#if defined(__MINGW32__) || defined(_MSC_VER)
 char* libnfs_strndup(const char *s, size_t n);
 #define strndup libnfs_strndup
 #endif
diff --git a/lib/nfs_v4.c b/lib/nfs_v4.c
index 31d89d7..dbbea95 100644
--- a/lib/nfs_v4.c
+++ b/lib/nfs_v4.c
@@ -88,6 +88,10 @@
 #include <pwd.h>
 #endif
 
+#ifdef WIN32
+#include <win32/win32_compat.h>
+#endif
+
 #include <ctype.h>
 #include <stdio.h>
 #include <stdarg.h>
-- 
2.45.0.windows.1


[Dauer der Verarbeitung: 0.4 Sekunden, vorverarbeitet 2026-10-24]