X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/cb48f1919ce8ccbd8587556c165a8b8b0d78d80f..9baf4d74a62f21448a30109ccc60efae22229a98:/src/system.h diff --git a/src/system.h b/src/system.h index 241a40d7..ba0aea3e 100644 --- a/src/system.h +++ b/src/system.h @@ -45,15 +45,8 @@ # include #endif -#if HAVE_UNISTD_H -# include -#endif - -#if HAVE_INTTYPES_H -# include -#endif - -#include +#include +#include #ifndef UINTPTR_MAX /* This isn't perfect, but it's good enough for Bison, which needs @@ -120,15 +113,6 @@ typedef size_t uintptr_t; #define N_(Msgid) (Msgid) -/*-------------------------------. -| Fix broken compilation flags. | -`-------------------------------*/ - -#ifndef LOCALEDIR -# define LOCALEDIR "/usr/local/share/locale" -#endif - - /*-----------. | Booleans. | `-----------*/ @@ -136,6 +120,21 @@ typedef size_t uintptr_t; #include + +/*-------------. +| Assertions. | +`-------------*/ + +/* 's assertions are too heavyweight, and can be disabled + too easily, so use aver rather than assert. */ +static inline void +aver (bool assertion) +{ + if (! assertion) + abort (); +} + + /*-----------. | Obstacks. | `-----------*/ @@ -210,11 +209,6 @@ 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). | `---------------------------------------------*/