From: John Darrington Date: Mon, 6 Jul 2020 19:44:57 +0000 (+0200) Subject: Keep systems happy which do not have sys/resource.h X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4ba0d4b24301f389dfb76a66094b093125fac9b;p=pspp Keep systems happy which do not have sys/resource.h --- 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"