Assume C89 or later.
[bpt/emacs.git] / src / vm-limit.c
index a08c300..c313a90 100644 (file)
@@ -1,6 +1,5 @@
 /* Functions for memory limit warnings.
-   Copyright (C) 1990, 1992, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-                 2008, 2009, 2010  Free Software Foundation, Inc.
+   Copyright (C) 1990, 1992, 2001-2012  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -17,18 +16,11 @@ GNU General Public License for more details.
 You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifdef emacs
 #include <config.h>
 #include <setjmp.h>
 #include "lisp.h"
-#endif
-
 #include "mem-limits.h"
 
-#ifdef HAVE_GETRLIMIT
-#include <sys/resource.h>
-#endif
-
 /*
   Level number of warnings already issued.
   0 -- no warnings issued.
@@ -37,9 +29,10 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
   3 -- 95% warning issued; keep warning frequently.
 */
 enum warnlevel { not_warned, warned_75, warned_85, warned_95 };
-
 static enum warnlevel warnlevel;
 
+typedef void *POINTER;
+
 /* Function to call to issue a warning;
    0 means don't issue them.  */
 static void (*warn_function) (const char *);
@@ -100,7 +93,7 @@ get_lim_data (void)
 }
 
 #else
-#if !defined (BSD4_2) && !defined (__osf__) && !defined (CYGWIN)
+#if !defined (BSD4_2) && !defined (CYGWIN)
 
 #ifdef MSDOS
 void
@@ -148,7 +141,7 @@ get_lim_data (void)
 }
 #endif /* not MSDOS */
 
-#else /* BSD4_2 */
+#else /* BSD4_2 || CYGWIN */
 
 static void
 get_lim_data (void)
@@ -173,9 +166,9 @@ static void
 check_memory_limits (void)
 {
 #ifdef REL_ALLOC
-  extern POINTER (*real_morecore) ();
+  extern POINTER (*real_morecore) (long);
 #endif
-  extern POINTER (*__morecore) ();
+  extern POINTER (*__morecore) (long);
 
   register POINTER cp;
   unsigned long five_percent;
@@ -244,7 +237,7 @@ check_memory_limits (void)
     (*warn_function) ("Warning: memory in use exceeds lisp pointer size");
 }
 \f
-#if !defined(CANNOT_DUMP) || !defined(SYSTEM_MALLOC)
+#if !defined (CANNOT_DUMP) || !defined (SYSTEM_MALLOC)
 /* Some systems that cannot dump also cannot implement these.  */
 
 /*
@@ -260,7 +253,7 @@ check_memory_limits (void)
  *
  */
 
-POINTER
+char *
 start_of_data (void)
 {
 #ifdef BSD_SYSTEM
@@ -304,6 +297,3 @@ memory_warnings (POINTER start, void (*warnfun) (const char *))
   /* Force data limit to be recalculated on each run.  */
   lim_data = 0;
 }
-
-/* arch-tag: eab04eda-1f69-447a-8d9f-95f0a3983ca5
-   (do not change this comment) */