source: trunk/src/sed/m4/obstack.m4@ 3669

Last change on this file since 3669 was 3611, checked in by bird, 10 months ago

vendor/sed/current: GNU sed 4.9 (sed-4.9.tar.xz sha256:6e226b732e1cd739464ad6862bd1a1aba42d7982922da7a53519631d24975181)

File size: 1.2 KB
Line 
1# See if we need to provide obstacks.
2
3dnl Copyright 1996-2022 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl Autoconf's AC_FUNC_OBSTACK is marked obsolete since version 2.70.
9dnl We provide our own macro here.
10
11AC_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])
Note: See TracBrowser for help on using the repository browser.