[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] 4 commits: win32: Fix duplicate definitions in arpa-inet.h, arpa-inet.c, and poll.h
PulseAudio Marge Bot
gitlab at gitlab.freedesktop.org
Wed Jan 13 03:47:53 UTC 2021
PulseAudio Marge Bot pushed to branch master at PulseAudio / pulseaudio
Commits:
fc002e4d by Patrick Gaskin at 2021-01-13T03:42:24+00:00
win32: Fix duplicate definitions in arpa-inet.h, arpa-inet.c, and poll.h
When _WIN32_WINNT >= 0x6000 (Vista), ws2tcpip.h provides inet_ntop and
inet_pton, and winsock2.h provides the equivalent of poll.h.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/458>
- - - - -
7ac0d906 by Patrick Gaskin at 2021-01-13T03:42:24+00:00
win32: Use __MINGW_PRINTF_FORMAT instead of __printf__ for MinGW builds
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/458>
- - - - -
dd87e9f2 by Patrick Gaskin at 2021-01-13T03:42:24+00:00
win32: Fix format specifiers for DWORD values
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/458>
- - - - -
613b3ebc by Patrick Gaskin at 2021-01-13T03:42:24+00:00
win32: Fix privlibdir for running on Windows
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/458>
- - - - -
8 changed files:
- meson.build
- src/pulse/gccmacro.h
- src/pulse/util.c
- src/pulsecore/arpa-inet.c
- src/pulsecore/arpa-inet.h
- src/pulsecore/conf-parser.c
- src/pulsecore/core-util.c
- src/pulsecore/poll.h
Changes:
=====================================
meson.build
=====================================
@@ -67,6 +67,11 @@ localstatedir = join_paths(prefix, get_option('localstatedir'))
sysconfdir = join_paths(prefix, get_option('sysconfdir'))
privlibdir = join_paths(libdir, 'pulseaudio')
+if host_machine.system() == 'windows'
+ # Windows only supports loading libraries from the same dir as the executable
+ privlibdir = bindir
+endif
+
alsadatadir = get_option('alsadatadir')
if alsadatadir == ''
alsadatadir = join_paths(datadir, 'pulseaudio', 'alsa-mixer')
=====================================
src/pulse/gccmacro.h
=====================================
@@ -25,10 +25,8 @@
#if defined(__GNUC__)
#ifdef __MINGW32__
-/* libintl overrides printf with a #define. As this breaks this attribute,
- * it has a workaround. However the workaround isn't enabled for MINGW
- * builds (only cygwin) */
-#define PA_GCC_PRINTF_ATTR(a,b) __attribute__ ((format (__printf__, a, b)))
+#include <stdio.h>
+#define PA_GCC_PRINTF_ATTR(a,b) __attribute__ ((format (__MINGW_PRINTF_FORMAT, a, b)))
#else
#define PA_GCC_PRINTF_ATTR(a,b) __attribute__ ((format (printf, a, b)))
#endif
=====================================
src/pulse/util.c
=====================================
@@ -510,7 +510,7 @@ int pa_thread_make_realtime(int rtprio) {
return 0;
}
- pa_log_warn("SetThreadPriority() failed: 0x%08X", GetLastError());
+ pa_log_warn("SetThreadPriority() failed: 0x%08lX", GetLastError());
errno = EPERM;
#else
errno = ENOTSUP;
=====================================
src/pulsecore/arpa-inet.c
=====================================
@@ -21,7 +21,7 @@
#include <config.h>
#endif
-#if !defined(HAVE_ARPA_INET_H) && defined(OS_IS_WIN32)
+#if !defined(HAVE_ARPA_INET_H) && defined(OS_IS_WIN32) && NTDDI_VERSION < NTDDI_VISTA
#include <errno.h>
=====================================
src/pulsecore/arpa-inet.h
=====================================
@@ -8,10 +8,12 @@
#elif defined(OS_IS_WIN32)
/* On Windows winsock2.h (here included via pulsecore/socket.h) provides most of the functionality of arpa/inet.h, except for
- * the inet_ntop and inet_pton functions, which are implemented here. */
+ * the inet_ntop and inet_pton functions, which are implemented here on versions earlier than Vista. */
#include <pulsecore/socket.h>
+#if NTDDI_VERSION < NTDDI_VISTA
+
const char *inet_ntop(int af, const void *src, char *dst, socklen_t cnt);
int inet_pton(int af, const char *src, void *dst);
@@ -19,3 +21,5 @@ int inet_pton(int af, const char *src, void *dst);
#endif
#endif
+
+#endif
=====================================
src/pulsecore/conf-parser.c
=====================================
@@ -251,7 +251,7 @@ finish:
LocalFree(msgbuf);
} else {
pa_log_warn("FindFirstFile(%s) failed with error %ld, ignoring.", pattern, err);
- pa_log_warn("FormatMessage failed with error %ld", GetLastError());
+ pa_log_warn("FormatMessage failed with error %lu", GetLastError());
}
}
}
=====================================
src/pulsecore/core-util.c
=====================================
@@ -759,7 +759,7 @@ int pa_raise_priority(int nice_level) {
#ifdef OS_IS_WIN32
if (nice_level < 0) {
if (!SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS)) {
- pa_log_warn("SetPriorityClass() failed: 0x%08X", GetLastError());
+ pa_log_warn("SetPriorityClass() failed: 0x%08lX", GetLastError());
errno = EPERM;
return -1;
}
@@ -1325,7 +1325,7 @@ int pa_lock_fd(int fd, int b) {
if (!b && UnlockFile(h, 0, 0, 0xFFFFFFFF, 0xFFFFFFFF))
return 0;
- pa_log("%slock failed: 0x%08X", !b ? "un" : "", GetLastError());
+ pa_log("%slock failed: 0x%08lX", !b ? "un" : "", GetLastError());
/* FIXME: Needs to set errno! */
#endif
@@ -3256,7 +3256,7 @@ char *pa_uname_string(void) {
i.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
pa_assert_se(GetVersionEx(&i));
- return pa_sprintf_malloc("Windows %d.%d (%d) %s", i.dwMajorVersion, i.dwMinorVersion, i.dwBuildNumber, i.szCSDVersion);
+ return pa_sprintf_malloc("Windows %lu.%lu (%lu) %s", i.dwMajorVersion, i.dwMinorVersion, i.dwBuildNumber, i.szCSDVersion);
#endif
}
=====================================
src/pulsecore/poll.h
=====================================
@@ -24,6 +24,8 @@
#if defined(HAVE_POLL_H)
#include <poll.h>
+#elif OS_IS_WIN32 && HAVE_WINSOCK2_H && NTDDI_VERSION >= NTDDI_VISTA
+#include <winsock2.h>
#else
/* Event types that can be polled for. These bits may be set in `events'
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/compare/0edcf725bcb77c5a3ae0c3473b775a85dbcd0236...613b3ebc2ccc3a39b49d033850e39d760d22b5aa
--
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/compare/0edcf725bcb77c5a3ae0c3473b775a85dbcd0236...613b3ebc2ccc3a39b49d033850e39d760d22b5aa
You're receiving this email because of your account on gitlab.freedesktop.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20210113/4b9eb2f8/attachment-0001.htm>
More information about the pulseaudio-commits
mailing list