X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/c21493b89f5f5dd49e1f46d311326d5d4f49f8a4..9350499cfce9122ebb065a582ab17e321b2e8ff3:/src/system.h diff --git a/src/system.h b/src/system.h index c1c45b49..241a40d7 100644 --- a/src/system.h +++ b/src/system.h @@ -41,8 +41,6 @@ #include #include -#include "unlocked-io.h" - #if HAVE_SYS_TYPES_H # include #endif @@ -54,30 +52,24 @@ #if HAVE_INTTYPES_H # include #endif -#if HAVE_STDINT_H -# include -#endif -#if ! HAVE_UINTPTR_T +#include + +#ifndef UINTPTR_MAX /* This isn't perfect, but it's good enough for Bison, which needs only to hash pointers. */ typedef size_t uintptr_t; #endif -#include - -#include -#include - -/*---------------------. -| Missing prototypes. | -`---------------------*/ +/*---------. +| Gnulib. | +`---------*/ #include - -/* From lib/basename.c. */ -char *base_name (char const *name); +#include +#include +#include /*-----------------. @@ -94,8 +86,8 @@ char *base_name (char const *name); #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ -# if !defined (__GNUC__) || __GNUC__ < 2 || \ -(__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ +# if (! defined __GNUC__ || __GNUC__ < 2 \ + || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__) # define __attribute__(Spec) /* empty */ # endif #endif @@ -115,6 +107,8 @@ char *base_name (char const *name); # define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #endif +#define FUNCTION_PRINT() fprintf (stderr, "%s: ", __func__) + /*------. | NLS. | `------*/ @@ -216,6 +210,11 @@ do { \ } while (0) +/* Assertions. 's assertions are too heavyweight, and can + be disabled too easily, so implement it separately here. */ +#define assert(x) ((void) ((x) || (abort (), 0))) + + /*---------------------------------------------. | Debugging memory allocation (must be last). | `---------------------------------------------*/