From ef3e9d1c2e570282b8783bf1f9a9525079e6014d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 5 Jul 2022 19:59:29 +0530 Subject: [PATCH] make various compilers happy --- prewarm-launcher.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/prewarm-launcher.c b/prewarm-launcher.c index dc6b1d4d5..cac09a2c0 100644 --- a/prewarm-launcher.c +++ b/prewarm-launcher.c @@ -7,7 +7,11 @@ // for SA_RESTART #define _XOPEN_SOURCE 700 // for cfmakeraw +#ifdef __APPLE__ +#define _DARWIN_C_SOURCE 1 +#else #define _DEFAULT_SOURCE +#endif // Includes {{{ #include @@ -32,8 +36,8 @@ #include #else #include -#include #endif +#include #define arraysz(x) (sizeof(x)/sizeof(x[0])) @@ -72,7 +76,7 @@ parse_long(const char *str, long *val) { static bool parse_int(const char *str, int *val) { - long lval; + long lval = 0; if (!parse_long(str, &lval)) return false; *val = lval; return true;