[vlc-commits] win32: only call SetErrorMode() if needed

Rémi Denis-Courmont git at videolan.org
Thu Nov 2 18:58:49 CET 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Nov  2 18:47:39 2017 +0200| [a93be48869e5dea838a04e439e8ca1beb370cc42] | committer: Rémi Denis-Courmont

win32: only call SetErrorMode() if needed

This call is only necessary on Win2k8 and earlier.

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

 bin/cachegen.c | 2 +-
 bin/winvlc.c   | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/bin/cachegen.c b/bin/cachegen.c
index 0e52559aaa..4045500507 100644
--- a/bin/cachegen.c
+++ b/bin/cachegen.c
@@ -48,7 +48,7 @@ static void usage (const char *path)
 
 int main (int argc, char *argv[])
 {
-#ifdef _WIN32
+#if defined(_WIN32) && (_WIN32_WINNT < _WIN32_WINNT_WIN7)
     SetErrorMode(SEM_FAILCRITICALERRORS);
 #endif
 #ifdef HAVE_GETOPT_H
diff --git a/bin/winvlc.c b/bin/winvlc.c
index d586bff934..cd7ee95fe2 100644
--- a/bin/winvlc.c
+++ b/bin/winvlc.c
@@ -129,7 +129,9 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
     putenv("VLC_DATA_PATH=Z:"TOP_SRCDIR"/share");
 #endif
 
+#if (_WIN32_WINNT < _WIN32_WINNT_WIN7)
     SetErrorMode(SEM_FAILCRITICALERRORS);
+#endif
     HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
 
     /* SetProcessDEPPolicy, SetDllDirectory, & Co. */



More information about the vlc-commits mailing list