New directory
[bpt/emacs.git] / src / alloca.c
index 3cea274..4b57437 100644 (file)
@@ -1,6 +1,9 @@
 /* alloca.c -- allocate automatically reclaimed memory
    (Mostly) portable public-domain implementation -- D A Gwyn
 
+   NOTE: The canonical source of this file is maintained with gnulib.
+   Bugs can be reported to bug-gnulib@gnu.org.
+
    This implementation of the PWB library alloca function,
    which is used to allocate space off the run-time stack so
    that it is automatically reclaimed upon procedure exit,
@@ -32,7 +35,7 @@
 # include <stdlib.h>
 #endif
 
-#ifdef emacs
+#ifdef DO_BLOCK_INPUT
 # include "lisp.h"
 # include "blockinput.h"
 #endif
    in order to make unexec workable
    */
 #    ifndef STACK_DIRECTION
-#     error "Must know STACK_DIRECTION at compile-time"
+you
+lose
+-- must know STACK_DIRECTION at compile-time
+/* Using #error here is not wise since this file should work for
+   old and obscure compilers.  */
 #    endif /* STACK_DIRECTION undefined */
 #   endif /* static */
 #  endif /* emacs */
@@ -90,7 +97,7 @@ typedef char *pointer;
 
    Callers below should use malloc.  */
 
-#  ifndef emacs
+#  ifdef emacs
 #   undef malloc
 #   define malloc xmalloc
 #   ifdef EMACS_FREE
@@ -176,7 +183,7 @@ static header *last_alloca_header = NULL;   /* -> last alloca header.  */
 
 pointer
 alloca (size)
-     unsigned size;
+     size_t size;
 {
   auto char probe;             /* Probes stack depth: */
   register char *depth = ADDRESS_FUNCTION (probe);
@@ -192,7 +199,7 @@ alloca (size)
   {
     register header *hp;       /* Traverses linked list.  */
 
-#  ifdef emacs
+#  ifdef DO_BLOCK_INPUT
     BLOCK_INPUT;
 #  endif
 
@@ -211,7 +218,7 @@ alloca (size)
 
     last_alloca_header = hp;   /* -> last valid storage.  */
 
-#  ifdef emacs
+#  ifdef DO_BLOCK_INPUT
     UNBLOCK_INPUT;
 #  endif
   }