Fix some syntax errors (#1243)

* 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
This commit is contained in:
Takase 2022-12-21 06:11:05 +08:00 committed by GitHub
parent 213dc7142e
commit 6d0e7f3046
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -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
@ -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
}