Skip to content

Commit

Permalink
Fix some syntax errors (lite-xl#1243)
Browse files Browse the repository at this point in the history
* move signal.h inclusion outside of if-else block
not sure if this change is appropriate, we need to make sure SIG_IGN
is only set on POSIX targets. To verify this we might need to include
unistd.h,

* fix syntax error
this is often overlooked when compiling for normal platforms
  • Loading branch information
takase1121 authored Dec 20, 2022
1 parent 213dc71 commit 6d0e7f3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
#include "rencache.h"
#include "renderer.h"

#include <signal.h>

#ifdef _WIN32
#include <windows.h>
#elif __linux__
#elif defined(__linux__)
#include <unistd.h>
#include <signal.h>
#elif __APPLE__
#elif defined(__APPLE__)
#include <mach-o/dyld.h>
#elif __FreeBSD__
#elif defined(__FreeBSD__)
#include <sys/sysctl.h>
#include <signal.h>
#endif


Expand Down Expand Up @@ -51,7 +51,7 @@ static void get_exe_filename(char *buf, int sz) {
const int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };
sysctl(mib, 4, buf, &len, NULL, 0);
#else
*buf = NULL;
*buf = 0;
#endif
}

Expand Down

0 comments on commit 6d0e7f3

Please sign in to comment.