X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/cb48f1919ce8ccbd8587556c165a8b8b0d78d80f..0213d65176bad71e1d33b257b5a6933525fef8a2:/src/system.h diff --git a/src/system.h b/src/system.h index 241a40d7..57a432d0 100644 --- a/src/system.h +++ b/src/system.h @@ -1,12 +1,12 @@ /* System-dependent definitions for Bison. - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #ifndef BISON_SYSTEM_H #define BISON_SYSTEM_H @@ -45,15 +44,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 @@ -66,7 +58,6 @@ typedef size_t uintptr_t; | Gnulib. | `---------*/ -#include #include #include #include @@ -120,15 +111,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 +118,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 +207,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). | `---------------------------------------------*/