summaryrefslogtreecommitdiffstats
path: root/m4/obstack.m4
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 16:58:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 16:58:41 +0000
commite1908ae95dd4c9d19ee4dfabfc8bf8a7f85943fe (patch)
treef5cc731bedcac0fb7fe14d952e4581e749f8bb87 /m4/obstack.m4
parentInitial commit. (diff)
downloadcoreutils-e1908ae95dd4c9d19ee4dfabfc8bf8a7f85943fe.tar.xz
coreutils-e1908ae95dd4c9d19ee4dfabfc8bf8a7f85943fe.zip
Adding upstream version 9.4.upstream/9.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'm4/obstack.m4')
-rw-r--r--m4/obstack.m433
1 files changed, 33 insertions, 0 deletions
diff --git a/m4/obstack.m4 b/m4/obstack.m4
new file mode 100644
index 0000000..ef70a52
--- /dev/null
+++ b/m4/obstack.m4
@@ -0,0 +1,33 @@
+# See if we need to provide obstacks.
+
+dnl Copyright 1996-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Autoconf's AC_FUNC_OBSTACK is marked obsolete since version 2.70.
+dnl We provide our own macro here.
+
+AC_DEFUN([gl_FUNC_OBSTACK],
+[
+ AC_CACHE_CHECK([for obstacks that work with any size object],
+ [gl_cv_func_obstack],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include "obstack.h"
+ void *obstack_chunk_alloc (size_t n) { return 0; }
+ void obstack_chunk_free (void *p) { }
+ /* Check that an internal function returns size_t, not int. */
+ size_t _obstack_memory_used (struct obstack *);
+ ]],
+ [[struct obstack mem;
+ obstack_init (&mem);
+ obstack_free (&mem, 0);
+ ]])],
+ [gl_cv_func_obstack=yes],
+ [gl_cv_func_obstack=no])])
+ if test "$gl_cv_func_obstack" = yes; then
+ AC_DEFINE([HAVE_OBSTACK], 1,
+ [Define to 1 if the system has obstacks that work with any size object.])
+ fi
+])