From 7607eeeb009f11539ca0d3d4058d978af8539e51 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 16 Aug 2017 20:03:24 -0400 Subject: [PATCH] Cleaned up some header inclusion politics. --- src/physfs_platform_apple.m | 8 +++----- src/physfs_platform_unix.c | 2 +- src/physfs_platform_windows.c | 8 +++----- src/physfs_platform_winrt.cpp | 7 ++----- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/physfs_platform_apple.m b/src/physfs_platform_apple.m index a674fb8d..fe50f4b0 100644 --- a/src/physfs_platform_apple.m +++ b/src/physfs_platform_apple.m @@ -7,16 +7,14 @@ */ #define __PHYSICSFS_INTERNAL__ -#include "physfs_internal.h" +#include "physfs_platforms.h" #ifdef PHYSFS_PLATFORM_APPLE -/* Foundation.h steps on these. :( */ -#undef malloc -#undef free - #include +#include "physfs_internal.h" + int __PHYSFS_platformInit(void) { return 1; /* success. */ diff --git a/src/physfs_platform_unix.c b/src/physfs_platform_unix.c index d8520a1e..10d93a7e 100644 --- a/src/physfs_platform_unix.c +++ b/src/physfs_platform_unix.c @@ -57,6 +57,7 @@ #include #endif + #include "physfs_internal.h" int __PHYSFS_platformInit(void) @@ -71,7 +72,6 @@ void __PHYSFS_platformDeinit(void) } /* __PHYSFS_platformDeinit */ -/* Stub version for platforms without CD-ROM support. */ void __PHYSFS_platformDetectAvailableCDs(PHYSFS_StringCallback cb, void *data) { #if (defined PHYSFS_NO_CDROM_SUPPORT) diff --git a/src/physfs_platform_windows.c b/src/physfs_platform_windows.c index 5fd28e32..49d6f550 100644 --- a/src/physfs_platform_windows.c +++ b/src/physfs_platform_windows.c @@ -7,7 +7,7 @@ */ #define __PHYSICSFS_INTERNAL__ -#include "physfs_internal.h" +#include "physfs_platforms.h" #ifdef PHYSFS_PLATFORM_WINDOWS @@ -16,9 +16,6 @@ #undef UNICODE #endif -/* !!! FIXME: maybe clean out the "allocator" macro, eventually. */ -#undef allocator /* apparently Windows 10 SDK conflicts here. */ - #define WIN32_LEAN_AND_MEAN 1 #include @@ -38,7 +35,8 @@ #ifdef allocator /* apparently Windows 10 SDK conflicts here. */ #undef allocator #endif -#define allocator __PHYSFS_AllocatorHooks + +#include "physfs_internal.h" /* * Users without the platform SDK don't have this defined. The original docs diff --git a/src/physfs_platform_winrt.cpp b/src/physfs_platform_winrt.cpp index 822673d8..5acc8c4c 100644 --- a/src/physfs_platform_winrt.cpp +++ b/src/physfs_platform_winrt.cpp @@ -17,13 +17,10 @@ #ifdef PHYSFS_PLATFORM_WINRT -#include "physfs_internal.h" - -/* !!! FIXME: maybe clean out the "allocator" macro, eventually. */ -#undef allocator /* apparently Windows 10 SDK conflicts here. */ - #include +#include "physfs_internal.h" + const void *__PHYSFS_winrtCalcBaseDir(void) { return Windows::ApplicationModel::Package::Current->InstalledLocation->Path->Data();