Debian Codegraph @

m4/obstack.m4

raw
1 # See if we need to provide obstacks.
2
3 dnl Copyright 1996-2023 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.
7
8 dnl Autoconf's AC_FUNC_OBSTACK is marked obsolete since version 2.70.
9 dnl We provide our own macro here.
10
11 AC_DEFUN([gl_FUNC_OBSTACK],
12 [
13 AC_CACHE_CHECK([for obstacks that work with any size object],
14 [gl_cv_func_obstack],
15 [AC_LINK_IFELSE(
16 [AC_LANG_PROGRAM(
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 *);
22 ]],
23 [[struct obstack mem;
24 obstack_init (&mem);
25 obstack_free (&mem, 0);
26 ]])],
27 [gl_cv_func_obstack=yes],
28 [gl_cv_func_obstack=no])])
29 if test "$gl_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.])
32 fi
33 ])