mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb/Gamepad: Forward declare SDL components to fix Windows build
We have to prevent from including any SDL headers in LibWeb headers. Otherwise there will be transitive Windows.h includes that will re-declare some of our existing forward decls/defines in LibCore/SocketAddressWindows.h
This commit is contained in:
parent
5ce518f493
commit
454e6a6f7f
Notes:
github-actions[bot]
2025-09-02 10:12:35 +00:00
Author: https://github.com/ayeteadoe
Commit: 454e6a6f7f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6046
Reviewed-by: https://github.com/Lubrsi ✅
11 changed files with 39 additions and 17 deletions
|
|
@ -16,6 +16,8 @@
|
|||
#include <LibWeb/HTML/Window.h>
|
||||
#include <LibWeb/HighResolutionTime/TimeOrigin.h>
|
||||
|
||||
#include <SDL3/SDL_gamepad.h>
|
||||
|
||||
namespace Web::Gamepad {
|
||||
|
||||
GC_DEFINE_ALLOCATOR(Gamepad);
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
|
||||
#include <LibWeb/Bindings/GamepadPrototype.h>
|
||||
#include <LibWeb/Bindings/PlatformObject.h>
|
||||
#include <LibWeb/Gamepad/SDLGamepadForward.h>
|
||||
#include <LibWeb/HighResolutionTime/DOMHighResTimeStamp.h>
|
||||
#include <SDL3/SDL_gamepad.h>
|
||||
|
||||
namespace Web::Gamepad {
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@
|
|||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Gamepad/GamepadButton.h>
|
||||
|
||||
#include <SDL3/SDL_gamepad.h>
|
||||
|
||||
namespace Web::Gamepad {
|
||||
|
||||
GC_DEFINE_ALLOCATOR(GamepadButton);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibWeb/Bindings/PlatformObject.h>
|
||||
#include <SDL3/SDL_gamepad.h>
|
||||
|
||||
namespace Web::Gamepad {
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@
|
|||
#include <LibWeb/HTML/Window.h>
|
||||
#include <LibWeb/HighResolutionTime/TimeOrigin.h>
|
||||
|
||||
#include <SDL3/SDL_gamepad.h>
|
||||
|
||||
namespace Web::Gamepad {
|
||||
|
||||
// https://w3c.github.io/gamepad/#dom-navigator-getgamepads
|
||||
|
|
|
|||
|
|
@ -9,10 +9,9 @@
|
|||
#include <LibGC/Ptr.h>
|
||||
#include <LibGC/RootVector.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
#include <LibWeb/Gamepad/SDLGamepadForward.h>
|
||||
#include <LibWeb/WebIDL/ExceptionOr.h>
|
||||
|
||||
#include <SDL3/SDL_gamepad.h>
|
||||
|
||||
namespace Web::Gamepad {
|
||||
|
||||
class NavigatorGamepadPartial {
|
||||
|
|
|
|||
16
Libraries/LibWeb/Gamepad/SDLGamepadForward.h
Normal file
16
Libraries/LibWeb/Gamepad/SDLGamepadForward.h
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* Copyright (c) 2025, ayeteadoe <ayeteadoe@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Types.h>
|
||||
|
||||
typedef uint32_t Uint32;
|
||||
typedef Uint32 SDL_JoystickID;
|
||||
|
||||
typedef struct SDL_Joystick SDL_Joystick;
|
||||
|
||||
typedef struct SDL_Gamepad SDL_Gamepad;
|
||||
Loading…
Add table
Add a link
Reference in a new issue