From c6de5af775912e007b92d1bed856b5e1ed34c5fc Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sun, 5 May 2019 09:45:34 +1000 Subject: [PATCH] Explicitly include headers on OSX --- src/Core.h | 2 +- src/Graphics.c | 2 +- src/Platform.c | 1 + src/Window.c | 11 ++++++----- src/Window.h | 4 ++-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/Core.h b/src/Core.h index 9bdc75eeb..39aca4406 100644 --- a/src/Core.h +++ b/src/Core.h @@ -59,7 +59,7 @@ typedef uint8_t bool; #ifndef NULL #ifdef __cplusplus -#define NULL nullptr +#define NULL 0 #else #define NULL ((void*)0) #endif diff --git a/src/Graphics.c b/src/Graphics.c index 9f9bee81a..169945195 100644 --- a/src/Graphics.c +++ b/src/Graphics.c @@ -373,7 +373,7 @@ static void D3D9_RecreateDevice(void) { void Gfx_Init(void) { Gfx.MinZNear = 0.05f; - void* winHandle = Window_GetWindowHandle(); + void* winHandle = Window_GetHandle(); d3d = Direct3DCreate9(D3D_SDK_VERSION); D3D9_FindCompatibleFormat(); diff --git a/src/Platform.c b/src/Platform.c index 3ddaba839..c648ebfda 100644 --- a/src/Platform.c +++ b/src/Platform.c @@ -89,6 +89,7 @@ const ReturnCode ReturnCode_SocketWouldBlock = EWOULDBLOCK; #elif defined CC_BUILD_OSX #include #include +#include #elif defined CC_BUILD_WEB #include #undef CC_BUILD_FREETYPE diff --git a/src/Window.c b/src/Window.c index 25facfefe..1d7396321 100644 --- a/src/Window.c +++ b/src/Window.c @@ -532,7 +532,7 @@ void Window_SetSize(int width, int height) { Rect_Width(rect), Rect_Height(rect), SWP_NOMOVE); } -void* Window_GetWindowHandle(void) { return win_handle; } +void* Window_GetHandle(void) { return win_handle; } bool Window_GetVisible(void) { return IsWindowVisible(win_handle); } void Window_SetVisible(bool visible) { @@ -970,7 +970,7 @@ void Window_SetVisible(bool visible) { } } -void* Window_GetWindowHandle(void) { return win_handle; } +void* Window_GetHandle(void) { return win_handle; } int Window_GetWindowState(void) { Atom prop_type; @@ -1566,6 +1566,7 @@ void Window_DisableRawMouse(void) { Window_DefaultDisableRawMouse(); } *#########################################################################################################################*/ #ifdef CC_BUILD_CARBON #include +#include static WindowRef win_handle; static int win_state; @@ -1995,7 +1996,7 @@ void Window_SetVisible(bool visible) { } } -void* Window_GetWindowHandle(void) { return win_handle; } +void* Window_GetHandle(void) { return win_handle; } int Window_GetWindowState(void) { if (win_state == WINDOW_STATE_FULLSCREEN) @@ -2275,7 +2276,7 @@ void Window_SetVisible(bool visible) { } } -void* Window_GetWindowHandle(void) { return win_handle; } +void* Window_GetHandle(void) { return win_handle; } int Window_GetWindowState(void) { Uint32 flags = SDL_GetWindowFlags(win_handle); @@ -2799,7 +2800,7 @@ void Window_SetClipboardText(const String* value) { bool Window_GetVisible(void) { return true; } void Window_SetVisible(bool visible) { } -void* Window_GetWindowHandle(void) { return NULL; } +void* Window_GetHandle(void) { return NULL; } int Window_GetWindowState(void) { EmscriptenFullscreenChangeEvent status; diff --git a/src/Window.h b/src/Window.h index c67e6b37e..f7b104648 100644 --- a/src/Window.h +++ b/src/Window.h @@ -72,7 +72,7 @@ bool Window_GetVisible(void); /* Sets whether the window is visible on screen at all. */ void Window_SetVisible(bool visible); /* Returns the platform-specific handle to the window. */ -void* Window_GetWindowHandle(void); +void* Window_GetHandle(void); /* Gets the current state of the window, see WindowState enum. */ int Window_GetWindowState(void); /* Sets the current state of the window, see WindowState enum. */ @@ -118,7 +118,7 @@ void Window_InitRaw(Bitmap* bmp); void Window_DrawRaw(Rect2D r); /* Begins listening for raw input and starts raising MouseEvents.RawMoved. */ -/* NOTE: Some backends only raise it when Window_UpdateRawMouse is called. */ +/* NOTE: Some backends only raise it when Window_UpdateRawMouse is called. */ /* Cursor will also be hidden and moved to window centre. */ void Window_EnableRawMouse(void); /* Updates mouse state. (such as centreing cursor) */