[vlc-commits] win32: remove unused vlc_win32_tmpfile

Steve Lhomme git at videolan.org
Thu Oct 15 12:05:12 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Oct 14 08:48:39 2020 +0200| [7e2763d0882002827d4192fc499b1d6870bd05db] | committer: Steve Lhomme

win32: remove unused vlc_win32_tmpfile

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7e2763d0882002827d4192fc499b1d6870bd05db
---

 include/vlc_fixups.h   |  4 ----
 src/win32/filesystem.c | 40 ----------------------------------------
 2 files changed, 44 deletions(-)

diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index 51286f56d6..9149c7519f 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -663,10 +663,6 @@ void sincosf(float, float *, float *);
 char *realpath(const char * restrict pathname, char * restrict resolved_path);
 #endif
 
-#ifdef _WIN32
-FILE *vlc_win32_tmpfile(void);
-#endif
-
 /* mingw-w64 has a broken IN6_IS_ADDR_MULTICAST macro */
 #if defined(_WIN32) && defined(__MINGW64_VERSION_MAJOR)
 # define IN6_IS_ADDR_MULTICAST IN6_IS_ADDR_MULTICAST
diff --git a/src/win32/filesystem.c b/src/win32/filesystem.c
index 0a0656dbba..d8e3cc1127 100644
--- a/src/win32/filesystem.c
+++ b/src/win32/filesystem.c
@@ -376,43 +376,3 @@ ssize_t vlc_sendmsg(int fd, const struct msghdr *msg, int flags)
 {
     return sendmsg(fd, msg, flags);
 }
-
-#if !VLC_WINSTORE_APP
-FILE *vlc_win32_tmpfile(void)
-{
-    WCHAR tmp_path[MAX_PATH-14];
-    int i_ret = GetTempPath (MAX_PATH-14, tmp_path);
-    if (i_ret == 0)
-        return NULL;
-
-    WCHAR tmp_name[MAX_PATH];
-    i_ret = GetTempFileName(tmp_path, TEXT("VLC"), 0, tmp_name);
-    if (i_ret == 0)
-        return NULL;
-
-    HANDLE hFile = CreateFile(tmp_name,
-            GENERIC_READ | GENERIC_WRITE | DELETE, 0, NULL, CREATE_ALWAYS,
-            FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_DELETE_ON_CLOSE, NULL);
-    if (hFile == INVALID_HANDLE_VALUE)
-        return NULL;
-
-    int fd = _open_osfhandle((intptr_t)hFile, 0);
-    if (fd == -1) {
-        CloseHandle(hFile);
-        return NULL;
-    }
-
-    FILE *stream = _fdopen(fd, "w+b");
-    if (stream == NULL) {
-        _close(fd);
-        return NULL;
-    }
-    return stream;
-}
-#else
-FILE *vlc_win32_tmpfile(void)
-{
-    return NULL;
-}
-#endif
-



More information about the vlc-commits mailing list