[vlc-commits] [Git][videolan/vlc][master] 6 commits: vlc_fixups: don't for disable warnings if the user already did it
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Fri Feb 17 07:37:53 UTC 2023
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
a6c3cff1 by Steve Lhomme at 2023-02-17T07:19:15+00:00
vlc_fixups: don't for disable warnings if the user already did it
The defines may already be set to 0/1 in the build environment.
- - - - -
091ecb2b by Steve Lhomme at 2023-02-17T07:19:15+00:00
win32: use WINAPI_PARTITION_APP to allow usage of SetPriorityClass()
This is how it's enabled in the Platform SDK
- - - - -
6f0b751f by Steve Lhomme at 2023-02-17T07:19:15+00:00
win32: only use single instance code on desktop builds
FindWindow() is only available with WINAPI_PARTITION_DESKTOP
- - - - -
57059049 by Steve Lhomme at 2023-02-17T07:19:15+00:00
win32: use _pipe() when _CRT_USE_WINAPI_FAMILY_DESKTOP_APP is defined
This is how it's enabled in the Platform SDK and mingw-w64 since
44e8e712a40bce1dbc76ada2c01b9326f17cb979 (mingw-w64 v8+)
- - - - -
6b3b5623 by Steve Lhomme at 2023-02-17T07:19:15+00:00
text/url: fix build when IDN_ALLOW_UNASSIGNED is missing
Some official SDKs have IdnToAscii but not IDN_ALLOW_UNASSIGNED.
- - - - -
984ccfa6 by Steve Lhomme at 2023-02-17T07:19:15+00:00
text/unicode: only use WriteConsoleW with WINAPI_PARTITION_APP
that's how it's defined in the Platform SDK and ming-w64
- - - - -
6 changed files:
- include/vlc_fixups.h
- src/text/unicode.c
- src/text/url.c
- src/win32/filesystem.c
- src/win32/specific.c
- src/win32/thread.c
Changes:
=====================================
include/vlc_fixups.h
=====================================
@@ -28,8 +28,12 @@
#if defined(_MSC_VER)
// disable common warnings when compiling POSIX code
+#ifndef _CRT_NONSTDC_NO_WARNINGS
#define _CRT_NONSTDC_NO_WARNINGS 1
+#endif
+#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS 1
+#endif
// sys/stat.h values
#define S_IWUSR _S_IWRITE
=====================================
src/text/unicode.c
=====================================
@@ -59,7 +59,7 @@ int utf8_vfprintf( FILE *stream, const char *fmt, va_list ap )
if (unlikely(res == -1))
return -1;
-#ifndef VLC_WINSTORE_APP
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
/* Writing to the console is a lot of fun on Microsoft Windows.
* If you use the standard I/O functions, you must use the OEM code page,
* which is different from the usual ANSI code page. Or maybe not, if the
@@ -89,7 +89,7 @@ int utf8_vfprintf( FILE *stream, const char *fmt, va_list ap )
}
else
res = -1;
-#ifndef VLC_WINSTORE_APP
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
out:
#endif
free (str);
=====================================
src/text/url.c
=====================================
@@ -31,7 +31,13 @@
#include <string.h>
#include <assert.h>
#ifdef _WIN32
+# include <windows.h>
# include <io.h>
+
+#ifndef IDN_ALLOW_UNASSIGNED // GAMES
+#define IDN_ALLOW_UNASSIGNED 0x01 // Allow unassigned "query" behavior per RFC 3454
+#endif
+
#endif
#include <vlc_common.h>
=====================================
src/win32/filesystem.c
=====================================
@@ -415,11 +415,19 @@ int vlc_dup2(int oldfd, int newfd)
int vlc_pipe (int fds[2])
{
-#ifdef VLC_WINSTORE_APP
+#if (defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 8)
+ // old mingw doesn't know about _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
+# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+ return _pipe (fds, 32768, O_NOINHERIT | O_BINARY);
+# else
_set_errno(EPERM);
return -1;
-#else
+# endif
+#elif defined(_CRT_USE_WINAPI_FAMILY_DESKTOP_APP)
return _pipe (fds, 32768, O_NOINHERIT | O_BINARY);
+#else
+ _set_errno(EPERM);
+ return -1;
#endif
}
=====================================
src/win32/specific.c
=====================================
@@ -71,7 +71,7 @@ typedef struct
void system_Configure( libvlc_int_t *p_this, int i_argc, const char *const ppsz_argv[] )
{
-#ifndef VLC_WINSTORE_APP
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
if( var_InheritBool( p_this, "one-instance" )
|| ( var_InheritBool( p_this, "one-instance-when-started-from-file" )
&& var_InheritBool( p_this, "started-from-file" ) ) )
=====================================
src/win32/thread.c
=====================================
@@ -694,7 +694,7 @@ void vlc_threads_setup(libvlc_int_t *vlc)
{
SelectClockSource(vlc);
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) || NTDDI_VERSION >= NTDDI_WIN10_RS3
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
/* Raise default priority of the current process */
#ifndef ABOVE_NORMAL_PRIORITY_CLASS
# define ABOVE_NORMAL_PRIORITY_CLASS 0x00008000
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ab9b509df6655da6b5980349808f472a2ce26268...984ccfa60e3fe154b173889c770b10196d04a0ce
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ab9b509df6655da6b5980349808f472a2ce26268...984ccfa60e3fe154b173889c770b10196d04a0ce
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list