From dc82c0b98d2f9a6a36d39fdabb5d06409f3e990e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= Date: Tue, 9 Jan 2024 17:18:38 +0200 Subject: [PATCH] update: update to 64-bit VLC on 64-bit Windows This is justified just by the sheer amount of 64-bit arithmetic we do. The only point in sticking to a 32-bit VLC is binary compatibility, either for external VLC plugins, or for LibVLC applications. But VLC 4.0 will break binary compatibility on both counts, so that is moot. This constitutes a once in a decade opportunity to smoothly switch over, considering how rarely LibVLC compatibility is broken. --- src/misc/update.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/misc/update.c b/src/misc/update.c index 5faa3642ea..dab7396f56 100644 --- a/src/misc/update.c +++ b/src/misc/update.c @@ -73,14 +73,6 @@ * Remaining text is a required description of the update */ -#if defined( _WIN64 ) -# define UPDATE_OS_SUFFIX "-win-x64" -#elif defined( _WIN32 ) -# define UPDATE_OS_SUFFIX "-win-x86" -#else -# define UPDATE_OS_SUFFIX "" -#endif - #ifndef NDEBUG # define UPDATE_VLC_STATUS_URL "http://update-test.videolan.org/vlc/status" #else @@ -179,7 +171,21 @@ static void EmptyRelease( update_t *p_update ) */ static bool GetUpdateFile( update_t *p_update ) { - static const char url[] = UPDATE_VLC_STATUS UPDATE_OS_SUFFIX; +#if defined(_WIN64) + static const char url[] = UPDATE_VLC_STATUS_URL "-win-x64"; +#elif defined(_WIN32) + static const char *urls[] = { + UPDATE_VLC_STATUS_URL "-win-x86", UPDATE_VLC_STATUS_URL "-win-x64" + }; + BOOL sixtyfour; + + if (!IsWow64Process(GetCurrentProcess(), &sixtyfour)) + sixtyfour = FALSE; // not clear how this can fail but MSDN says so + + const char *url = urls[sixtyfour != FALSE]; +#else + static const char url[] = UPDATE_VLC_STATUS_URL; +#endif stream_t *p_stream = NULL; char *psz_version_line = NULL; char *psz_update_data = NULL;