Skip to content

Commit

Permalink
Mac: Less warnings when compiling with modern xcode
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownShadow200 committed Jan 10, 2021
1 parent 3ad1f1f commit 19cdffd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/Chat.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ void Chat_DisableLogging(void) {
static cc_bool CreateLogsDirectory(void) {
static const cc_string dir = String_FromConst("logs");
cc_result res;
/* Utils_EnsureDirectory cannot be used here because it causes a stack overflow */
/* Utils_EnsureDirectory cannot be used here because it causes a stack overflow */
/* when running the game and an error occurs when trying to create the directory */
/* This happens because when running the game, Logger_WarnFunc is changed to log
/* a message in chat instead of showing a dialog box, which causes the following
/* This happens because when running the game, Logger_WarnFunc is changed to log */
/* a message in chat instead of showing a dialog box, which causes the following */
/* functions to be called in a recursive loop: */
/* */
/* */
/* Utils_EnsureDirectory --> Logger_SysWarn2 --> Chat_Add --> AppendChatLog -> OpenChatLog */
/* --> Utils_EnsureDirectory --> Logger_SysWarn2 --> Chat_Add --> AppendChatLog -> OpenChatLog */
/* --> Utils_EnsureDirectory --> Logger_SysWarn2 --> Chat_Add --> AppendChatLog -> OpenChatLog */
Expand Down
5 changes: 2 additions & 3 deletions src/Platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -1691,9 +1691,8 @@ static void Platform_InitStopwatch(void) {

#if defined CC_BUILD_MACOS
static void Platform_InitSpecific(void) {
ProcessSerialNumber psn; /* TODO: kCurrentProcess */
/* NOTE: Call as soon as possible, otherwise can't click on dialog boxes. */
GetCurrentProcess(&psn);
ProcessSerialNumber psn = { 0, kCurrentProcess };
/* NOTE: Call as soon as possible, otherwise can't click on dialog boxes or create windows */
/* NOTE: TransformProcessType is macOS 10.3 or later */
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
}
Expand Down

0 comments on commit 19cdffd

Please sign in to comment.