From f4ba0d4b24301f389dfb76a66094b093125fac9b Mon Sep 17 00:00:00 2001 From: John Darrington Date: Mon, 6 Jul 2020 21:44:57 +0200 Subject: [PATCH] Keep systems happy which do not have sys/resource.h --- configure.ac | 2 ++ src/ui/gui/main.c | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 50b7472f9d..24cb008fcb 100644 --- a/configure.ac +++ b/configure.ac @@ -56,6 +56,8 @@ if test "x$MSGFMT" = x; then PSPP_REQUIRED_PREREQ([msgfmt (is usually provided with gettext)]) fi +AC_CHECK_HEADERS([sys/resource.h]) + dnl Checks for libraries. AC_SYS_LARGEFILE diff --git a/src/ui/gui/main.c b/src/ui/gui/main.c index ecb07f83ff..9a7f8e1987 100644 --- a/src/ui/gui/main.c +++ b/src/ui/gui/main.c @@ -22,11 +22,22 @@ #include #include #include -#include #if ENABLE_RELOCATABLE && defined(__APPLE__) +#include static const bool apple_relocatable = true; #else static const bool apple_relocatable = false; +#if HAVE_SYS_RESOURCE_H +#include +#else +/* Dummy definitions to keep the compiler happy. */ +struct rlimit +{ + int rlim_cur; + int rlim_max; +}; +#define RLIMIT_NOFILE 0 +#endif #endif #include "language/lexer/include-path.h" -- 2.30.2