From 28f0df681c9a016fa847c92b8b7986f66ea5fc85 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 24 May 2016 16:26:24 +0530 Subject: [PATCH] winks: Port to MSVC and pretend to be Windows XP strcasecmp is not defined on MSVC, so just use the glib wrapper. Also pretend to be Windows XP explicitly since the API we use was deprecated and removed (ifdef-ed) from the SDK after this version of Windows. This will be especially relevant once we stop supporting Windows XP soon: https://bugzilla.gnome.org/show_bug.cgi?id=756866 --- sys/winks/ksdeviceprovider.c | 4 ++-- sys/winks/kshelpers.c | 6 ++++++ sys/winks/kshelpers.h | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/winks/ksdeviceprovider.c b/sys/winks/ksdeviceprovider.c index 54429ebe6b..609794d448 100644 --- a/sys/winks/ksdeviceprovider.c +++ b/sys/winks/ksdeviceprovider.c @@ -355,7 +355,7 @@ msg_window_message_proc (HWND window_handle, UINT message, entry->path); if ((source == NULL) && - (strcasecmp (entry->path, bcdi->dbcc_name) == 0)) + (g_ascii_strcasecmp (entry->path, bcdi->dbcc_name) == 0)) source = new_video_source (entry); ks_device_entry_free (entry); @@ -377,7 +377,7 @@ msg_window_message_proc (HWND window_handle, UINT message, for (item = provider->devices; item; item = item->next) { dev = item->data; - if (strcasecmp (dev->path, bcdi->dbcc_name) == 0) { + if (g_ascii_strcasecmp (dev->path, bcdi->dbcc_name) == 0) { guid_str = gst_device_get_display_name (GST_DEVICE (dev)); GST_INFO_OBJECT (self, "Device matches to %s", guid_str); g_free (guid_str); diff --git a/sys/winks/kshelpers.c b/sys/winks/kshelpers.c index bbb9b066f1..3b5ec28a4f 100644 --- a/sys/winks/kshelpers.c +++ b/sys/winks/kshelpers.c @@ -19,6 +19,12 @@ #include "kshelpers.h" +/* This plugin is from the era of Windows XP and uses APIs that have been + * deprecated since then. Let's pretend we're Windows XP too so that Windows + * lets us use that deprecated API. */ +#define NTDDI_VERSION NTDDI_WINXP +#define _WIN32_WINNT _WIN32_WINNT_WINXP + #include #include #include diff --git a/sys/winks/kshelpers.h b/sys/winks/kshelpers.h index 5181bfcd11..ded8101f59 100644 --- a/sys/winks/kshelpers.h +++ b/sys/winks/kshelpers.h @@ -22,6 +22,7 @@ #include #include +#include #include G_BEGIN_DECLS