Skip to content

Commit

Permalink
[Mac] Guard Obj-C preprocessor directives with __OBJC__ in public pla…
Browse files Browse the repository at this point in the history
…tform headers.
  • Loading branch information
LukasBanana committed Feb 19, 2025
1 parent 9fa7506 commit 918bc05
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
11 changes: 10 additions & 1 deletion include/LLGL/Platform/IOS/IOSNativeHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,26 @@
#define LLGL_IOS_NATIVE_HANDLE_H


#ifdef __OBJC__
#include <UIKit/UIKit.h>
#endif


namespace LLGL
{


//! iOS native handle structure.
/**
\brief iOS native handle structure.
\see Surface::GetNativeHandle
*/
struct NativeHandle
{
#ifdef __OBJC__
UIView* view;
#else
void* view;
#endif
};


Expand Down
8 changes: 7 additions & 1 deletion include/LLGL/Platform/MacOS/MacOSNativeHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
#define LLGL_MACOS_NATIVE_HANDLE_H


#ifdef __OBJC__
#include <Cocoa/Cocoa.h>
#endif


namespace LLGL
Expand All @@ -18,7 +20,7 @@ namespace LLGL

/**
\brief MacOS native handle structure.
\see Window::GetNativeHandle
\see Surface::GetNativeHandle
\see WindowDescriptor::windowContext
*/
struct NativeHandle
Expand All @@ -30,7 +32,11 @@ struct NativeHandle
- \b Subview if it points to an \c NSView, in which case the respective \c MTKView (Metal) or \c GLKView (OpenGL) will be \e added as a subview.
\see WindowDescriptor::windowContext
*/
#ifdef __OBJC__
NSResponder* responder;
#else
void* responder;
#endif
};


Expand Down

0 comments on commit 918bc05

Please sign in to comment.