From 6d0e7f304671ace543d8ebd5297315d97e031311 Mon Sep 17 00:00:00 2001 From: Takase <20792268+takase1121@users.noreply.github.com> Date: Wed, 21 Dec 2022 06:11:05 +0800 Subject: [PATCH] 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 --- src/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.c b/src/main.c index 03edef6..1091005 100644 --- a/src/main.c +++ b/src/main.c @@ -5,16 +5,16 @@ #include "rencache.h" #include "renderer.h" +#include + #ifdef _WIN32 #include -#elif __linux__ +#elif defined(__linux__) #include - #include -#elif __APPLE__ +#elif defined(__APPLE__) #include -#elif __FreeBSD__ +#elif defined(__FreeBSD__) #include - #include #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 }