Keep systems happy which do not have sys/resource.h
[pspp] / src / ui / gui / main.c
index ecb07f83ff378fb6c2c725220396642a68b551f5..9a7f8e1987a7d8a7def941e471df7f37bc500e79 100644 (file)
 #include <gtk/gtk.h>
 #include <stdlib.h>
 #include <sys/stat.h>
-#include <sys/resource.h>
 #if ENABLE_RELOCATABLE && defined(__APPLE__)
+#include <sys/resource.h>
 static const bool apple_relocatable = true;
 #else
 static const bool apple_relocatable = false;
+#if HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#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"