[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gnulib] alloca patch to assume C89 or better
From: |
Paul Eggert |
Subject: |
[Bug-gnulib] alloca patch to assume C89 or better |
Date: |
08 Sep 2003 16:01:30 -0700 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
I installed this:
2003-09-08 Paul Eggert <address@hidden>
* lib/alloca.c: Include <string.h>, <stdlib.h> unconditionally.
(POINTER_TYPE, pointer): Remove; all uses changed to void *.
(NULL): Remove.
(find_stack_direction, alloca): Use prototypes.
* m4/alloca.m4 (gl_PREREQ_ALLOCA): Don't check for stdlib.h, string.h.
Index: lib/alloca.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/alloca.c,v
retrieving revision 1.10
diff -p -u -r1.10 alloca.c
--- lib/alloca.c 9 Aug 2003 08:57:49 -0000 1.10
+++ lib/alloca.c 8 Sep 2003 22:54:17 -0000
@@ -25,12 +25,8 @@
# include <config.h>
#endif
-#if HAVE_STRING_H
-# include <string.h>
-#endif
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
+#include <string.h>
+#include <stdlib.h>
#ifdef emacs
# include "lisp.h"
@@ -77,19 +73,6 @@ long i00afunc ();
# define ADDRESS_FUNCTION(arg) &(arg)
# endif
-# ifndef POINTER_TYPE
-# ifdef __STDC__
-# define POINTER_TYPE void
-# else
-# define POINTER_TYPE char
-# endif
-# endif
-typedef POINTER_TYPE *pointer;
-
-# ifndef NULL
-# define NULL 0
-# endif
-
/* Define STACK_DIRECTION if you know the direction of stack
growth for your system; otherwise it will be automatically
deduced at run-time.
@@ -112,7 +95,7 @@ static int stack_dir; /* 1 or -1 once k
# define STACK_DIR stack_dir
static void
-find_stack_direction ()
+find_stack_direction (void)
{
static char *addr = NULL; /* Address of first `dummy', once known. */
auto char dummy; /* To get stack address. */
@@ -165,9 +148,8 @@ static header *last_alloca_header = NULL
caller, but that method cannot be made to work for some
implementations of C, for example under Gould's UTX/32. */
-pointer
-alloca (size)
- size_t size;
+void *
+alloca (size_t size)
{
auto char probe; /* Probes stack depth: */
register char *depth = ADDRESS_FUNCTION (probe);
@@ -214,7 +196,7 @@ alloca (size)
{
/* Address of header. */
- register pointer new;
+ register void *new;
size_t combined_size = sizeof (header) + size;
if (combined_size < sizeof (header))
@@ -232,7 +214,7 @@ alloca (size)
/* User storage begins just after header. */
- return (pointer) ((char *) new + sizeof (header));
+ return (void *) ((char *) new + sizeof (header));
}
}
Index: m4/alloca.m4
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/alloca.m4,v
retrieving revision 1.4
diff -p -u -r1.4 alloca.m4
--- m4/alloca.m4 30 May 2003 13:12:15 -0000 1.4
+++ m4/alloca.m4 8 Sep 2003 22:54:17 -0000
@@ -1,4 +1,4 @@
-# alloca.m4 serial 2 (gettext-0.12)
+# alloca.m4 serial 3
dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
@@ -31,6 +31,4 @@ AC_DEFUN([gl_FUNC_ALLOCA],
# Prerequisites of lib/alloca.c.
# STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
-AC_DEFUN([gl_PREREQ_ALLOCA], [
- AC_CHECK_HEADERS_ONCE(stdlib.h string.h)
-])
+AC_DEFUN([gl_PREREQ_ALLOCA], [:])
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug-gnulib] alloca patch to assume C89 or better,
Paul Eggert <=