Blame m4/obstack.m4

Packit 709fb3
# See if we need to provide obstacks.
Packit 709fb3
Packit 709fb3
dnl Copyright 1996-2017 Free Software Foundation, Inc.
Packit 709fb3
dnl This file is free software; the Free Software Foundation
Packit 709fb3
dnl gives unlimited permission to copy and/or distribute it,
Packit 709fb3
dnl with or without modifications, as long as this notice is preserved.
Packit 709fb3
Packit 709fb3
dnl This replaces Autoconf's AC_FUNC_OBSTACK.
Packit 709fb3
dnl The Autoconf version should be marked obsolete at some point.
Packit 709fb3
Packit 709fb3
AC_DEFUN([AC_FUNC_OBSTACK],
Packit 709fb3
  [AC_LIBSOURCES([obstack.h, obstack.c])dnl
Packit 709fb3
   AC_CACHE_CHECK([for obstacks that work with any size object],
Packit 709fb3
     [ac_cv_func_obstack],
Packit 709fb3
     [AC_LINK_IFELSE(
Packit 709fb3
        [AC_LANG_PROGRAM(
Packit 709fb3
           [[#include "obstack.h"
Packit 709fb3
             void *obstack_chunk_alloc (size_t n) { return 0; }
Packit 709fb3
             void obstack_chunk_free (void *p) { }
Packit 709fb3
             /* Check that an internal function returns size_t, not int.  */
Packit 709fb3
             size_t _obstack_memory_used (struct obstack *);
Packit 709fb3
            ]],
Packit 709fb3
           [[struct obstack mem;
Packit 709fb3
             obstack_init (&mem;;
Packit 709fb3
             obstack_free (&mem, 0);
Packit 709fb3
           ]])],
Packit 709fb3
        [ac_cv_func_obstack=yes],
Packit 709fb3
        [ac_cv_func_obstack=no])])
Packit 709fb3
   if test "$ac_cv_func_obstack" = yes; then
Packit 709fb3
     AC_DEFINE([HAVE_OBSTACK], 1,
Packit 709fb3
       [Define to 1 if the system has obstacks that work with any size object.])
Packit 709fb3
   else
Packit 709fb3
     AC_LIBOBJ([obstack])
Packit 709fb3
   fi
Packit 709fb3
])