1 # See if we need to provide obstacks.
3 dnl Copyright 1996-2020 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This replaces Autoconf's AC_FUNC_OBSTACK.
9 dnl The Autoconf version should be marked obsolete at some point.
11 AC_DEFUN([AC_FUNC_OBSTACK],
12 [AC_LIBSOURCES([obstack.h, obstack.c])dnl
13 AC_CACHE_CHECK([for obstacks that work with any size object],
17 [[#include "obstack.h"
18 void *obstack_chunk_alloc (size_t n) { return 0; }
19 void obstack_chunk_free (void *p) { }
20 /* Check that an internal function returns size_t, not int. */
21 size_t _obstack_memory_used (struct obstack *);
25 obstack_free (&mem, 0);
27 [ac_cv_func_obstack=yes],
28 [ac_cv_func_obstack=no])])
29 if test "$ac_cv_func_obstack" = yes; then
30 AC_DEFINE([HAVE_OBSTACK], 1,
31 [Define to 1 if the system has obstacks that work with any size object.])