License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
-
-
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-#ifdef _LIBC
-# include <obstack.h>
-# include <shlib-compat.h>
-#else
-# include "obstack.h"
-#endif
+#include "obstack.h"
/* NOTE BEFORE MODIFYING THIS FILE: This version number must be
incremented whenever callers compiled using an old obstack.h can no
longer properly call the functions in this obstack.c. */
#define OBSTACK_INTERFACE_VERSION 1
-/* Comment out all this code if we are using the GNU C Library, and are not
- actually compiling the library itself, and the installed library
- supports the same library interface we do. This code is part of the GNU
- C Library, but also included in many other GNU distributions. Compiling
- and linking in this code is a waste when using the GNU C library
- (especially if it is a shared library). Rather than having every GNU
- program understand `configure --with-gnu-libc' and omit the object
- files, it is simpler to just do this in the source for each such file. */
-
#include <stdio.h> /* Random thing to get __GNU_LIBRARY__. */
-#if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
-# include <gnu-versions.h>
-# if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION
-# define ELIDE_CODE
-# endif
-#endif
-
#include <stddef.h>
-
-#ifndef ELIDE_CODE
-
-
-# if HAVE_INTTYPES_H
-# include <inttypes.h>
-# endif
-# if HAVE_STDINT_H || defined _LIBC
-# include <stdint.h>
-# endif
+#include <stdint.h>
/* Determine default alignment. */
union fooround
/* Exit value used when `print_and_abort' is used. */
# include <stdlib.h>
-# ifdef _LIBC
int obstack_exit_failure = EXIT_FAILURE;
-# else
-# include "exitfail.h"
-# define obstack_exit_failure exit_failure
-# endif
-
-# ifdef _LIBC
-# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
-/* A looong time ago (before 1994, anyway; we're not sure) this global variable
- was used by non-GNU-C macros to avoid multiple evaluation. The GNU C
- library still exports it because somebody might use it. */
-struct obstack *_obstack_compat;
-compat_symbol (libc, _obstack_compat, _obstack, GLIBC_2_0);
-# endif
-# endif
/* Define a macro that either calls functions with the traditional malloc/free
calling interface, or calls functions with the mmalloc/mfree interface
/* The new chunk certainly contains no empty object yet. */
h->maybe_empty_object = 0;
}
-# ifdef _LIBC
-libc_hidden_def (_obstack_newchunk)
-# endif
/* Return nonzero if object OBJ has been allocated from obstack H.
This is here for debugging.
abort ();
}
-# ifdef _LIBC
-/* Older versions of libc used a function _obstack_free intended to be
- called by non-GCC compilers. */
-strong_alias (obstack_free, _obstack_free)
-# endif
-\f
int
_obstack_memory_used (struct obstack *h)
{
}
return nbytes;
}
-\f
-/* Define the error handler. */
-# ifdef _LIBC
-# include <libintl.h>
-# else
-# include "gettext.h"
-# endif
-# ifndef _
-# define _(msgid) gettext (msgid)
-# endif
-
-# ifdef _LIBC
-# include <libio/iolibio.h>
-# endif
-
-# ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
-# define __attribute__(Spec) /* empty */
-# endif
-# endif
static void
__attribute__ ((noreturn))
happen because the "memory exhausted" message appears in other places
like this and the translation should be reused instead of creating
a very similar string which requires a separate translation. */
-# ifdef _LIBC
- (void) __fxprintf (NULL, "%s\n", _("memory exhausted"));
-# else
- fprintf (stderr, "%s\n", _("memory exhausted"));
-# endif
+ fprintf (stderr, "%s\n", "memory exhausted");
exit (obstack_exit_failure);
}
-#endif /* !ELIDE_CODE */