Skip to content

Commit f241e8e

Browse files
sezeroslouken
authored andcommitted
windows: replace shobjidl_core.h usage with shobjidl.h except for when targeting xbox
Closes #13571
1 parent 1c5c3b1 commit f241e8e

10 files changed

+13
-23
lines changed

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2016,7 +2016,6 @@ elseif(WINDOWS)
20162016
check_include_file(audioclient.h HAVE_AUDIOCLIENT_H)
20172017
check_include_file(sensorsapi.h HAVE_SENSORSAPI_H)
20182018
check_include_file(shellscalingapi.h HAVE_SHELLSCALINGAPI_H)
2019-
check_include_file(shobjidl_core.h HAVE_SHOBJIDL_CORE_H)
20202019
check_c_source_compiles("
20212020
#include <windows.h>
20222021
#include <mfapi.h>

cmake/PreseedMSVCCache.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ if(MSVC)
1515
set(HAVE_MMDEVICEAPI_H "1" CACHE INTERNAL "Have include mmdeviceapi.h")
1616
set(HAVE_SENSORSAPI_H "1" CACHE INTERNAL "Have include sensorsapi.h")
1717
set(HAVE_SHELLSCALINGAPI_H "1" CACHE INTERNAL "Have include shellscalingapi.h")
18-
set(HAVE_SHOBJIDL_CORE_H "1" CACHE INTERNAL "Have include shobjidl_core.h")
1918
set(HAVE_TPCSHRD_H "1" CACHE INTERNAL "Have include tpcshrd.h")
2019
set(HAVE_WIN32_CC "1" CACHE INTERNAL "Test HAVE_WIN32_CC")
2120
set(HAVE_XINPUT_H "1" CACHE INTERNAL "Test HAVE_XINPUT_H")

include/build_config/SDL_build_config.h.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@
229229
#cmakedefine HAVE_TPCSHRD_H 1
230230
#cmakedefine HAVE_ROAPI_H 1
231231
#cmakedefine HAVE_SHELLSCALINGAPI_H 1
232-
#cmakedefine HAVE_SHOBJIDL_CORE_H 1
233232

234233
#cmakedefine USE_POSIX_SPAWN 1
235234
#cmakedefine HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR 1

include/build_config/SDL_build_config_windows.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,6 @@ typedef unsigned int uintptr_t;
9595
#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0603 /* Windows 8.1 SDK */
9696
#define HAVE_SHELLSCALINGAPI_H 1
9797
#endif
98-
#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0601 /* Windows 7 SDK */
99-
#define HAVE_SHOBJIDL_CORE_H 1
100-
#endif
10198
#define HAVE_MMDEVICEAPI_H 1
10299
#define HAVE_AUDIOCLIENT_H 1
103100
#define HAVE_TPCSHRD_H 1

include/build_config/SDL_build_config_wingdk.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
#define HAVE_D3D11_H 1
4444
#define HAVE_ROAPI_H 1
4545
#define HAVE_SHELLSCALINGAPI_H 1
46-
#define HAVE_SHOBJIDL_CORE_H 1
4746
#define HAVE_MMDEVICEAPI_H 1
4847
#define HAVE_AUDIOCLIENT_H 1
4948
#define HAVE_TPCSHRD_H 1
@@ -146,7 +145,7 @@
146145
#define HAVE_TRUNC 1
147146
#define HAVE_TRUNCF 1
148147
#define HAVE__FSEEKI64 1
149-
#endif /* _MSC_VER */
148+
#endif /* _MSC_VER */
150149

151150
/* Enable various audio drivers */
152151
#if defined(HAVE_MMDEVICEAPI_H) && defined(HAVE_AUDIOCLIENT_H)

include/build_config/SDL_build_config_xbox.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
/*#define HAVE_WINDOWS_GAMING_INPUT_H 1*/
4242
/*#define HAVE_ROAPI_H 1*/
4343
/*#define HAVE_SHELLSCALINGAPI_H 1*/
44-
/*#define HAVE_SHOBJIDL_CORE_H 1*/
4544
#define HAVE_MMDEVICEAPI_H 1
4645
#define HAVE_AUDIOCLIENT_H 1
4746
/*#define HAVE_TPCSHRD_H 1*/
@@ -145,7 +144,7 @@
145144
#define HAVE_TRUNC 1
146145
#define HAVE_TRUNCF 1
147146
#define HAVE__FSEEKI64 1
148-
#endif /* _MSC_VER */
147+
#endif /* _MSC_VER */
149148

150149
/* Enable various audio drivers */
151150
#if defined(HAVE_MMDEVICEAPI_H) && defined(HAVE_AUDIOCLIENT_H)

src/video/windows/SDL_windowsevents.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
#include "wmmsg.h"
5252
#endif
5353

54-
#ifdef HAVE_SHOBJIDL_CORE_H
55-
#include <shobjidl_core.h>
54+
#if !(defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES))
55+
#include <shobjidl.h>
5656
#endif
5757

5858
#ifdef SDL_PLATFORM_GDK
@@ -2412,7 +2412,7 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
24122412
#endif // !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)
24132413
}
24142414

2415-
#ifdef HAVE_SHOBJIDL_CORE_H
2415+
#if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)
24162416
if (msg == data->videodata->WM_TASKBAR_BUTTON_CREATED) {
24172417
data->taskbar_button_created = true;
24182418
WIN_ApplyWindowProgress(SDL_GetVideoDevice(), data->window);

src/video/windows/SDL_windowsvideo.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
#include "SDL_windowsrawinput.h"
3737
#include "SDL_windowsvulkan.h"
3838

39-
#ifdef HAVE_SHOBJIDL_CORE_H
40-
#include <shobjidl_core.h>
39+
#if !(defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES))
40+
#include <shobjidl.h>
4141
#endif
4242

4343
#ifdef SDL_GDK_TEXTINPUT
@@ -553,7 +553,7 @@ static bool WIN_VideoInit(SDL_VideoDevice *_this)
553553
#if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)
554554
data->_SDL_WAKEUP = RegisterWindowMessageA("_SDL_WAKEUP");
555555
#endif
556-
#if defined(HAVE_SHOBJIDL_CORE_H)
556+
#if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)
557557
data->WM_TASKBAR_BUTTON_CREATED = RegisterWindowMessageA("TaskbarButtonCreated");
558558
#endif
559559

@@ -579,12 +579,10 @@ void WIN_VideoQuit(SDL_VideoDevice *_this)
579579
WIN_QuitKeyboard(_this);
580580
WIN_QuitMouse(_this);
581581

582-
#if defined(HAVE_SHOBJIDL_CORE_H)
583582
if (data->taskbar_list) {
584583
IUnknown_Release(data->taskbar_list);
585584
data->taskbar_list = NULL;
586585
}
587-
#endif
588586

589587
if (data->oleinitialized) {
590588
OleUninitialize();

src/video/windows/SDL_windowsvideo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ struct SDL_VideoData
541541
BYTE pre_hook_key_state[256];
542542
UINT _SDL_WAKEUP;
543543

544-
#ifdef HAVE_SHOBJIDL_CORE_H
544+
#if !(defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES))
545545
UINT WM_TASKBAR_BUTTON_CREATED;
546546
ITaskbarList3 *taskbar_list;
547547
#endif

src/video/windows/SDL_windowswindow.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
// Dropfile support
4040
#include <shellapi.h>
4141

42-
#ifdef HAVE_SHOBJIDL_CORE_H
43-
#include <shobjidl_core.h>
42+
#if !(defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES))
43+
#include <shobjidl.h>
4444
#endif
4545

4646
// Dark mode support
@@ -179,7 +179,7 @@ static DWORD GetWindowStyleEx(SDL_Window *window)
179179
return style;
180180
}
181181

182-
#ifdef HAVE_SHOBJIDL_CORE_H
182+
#if !(defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES))
183183
static ITaskbarList3 *GetTaskbarList(SDL_Window *window)
184184
{
185185
const SDL_WindowData *data = window->internal;
@@ -2194,7 +2194,7 @@ bool WIN_FlashWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOperat
21942194

21952195
bool WIN_ApplyWindowProgress(SDL_VideoDevice *_this, SDL_Window *window)
21962196
{
2197-
#ifdef HAVE_SHOBJIDL_CORE_H
2197+
#if !(defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES))
21982198
SDL_WindowData *data = window->internal;
21992199
if (!data->taskbar_button_created) {
22002200
return true;

0 commit comments

Comments
 (0)