X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/0f37a9942fa297c9e45e5224844c1938a45834f2..3a7456dd96820eea36e9f9656c7f5e29714f78d4:/src/system.h diff --git a/src/system.h b/src/system.h index bfd24463..70605c49 100644 --- a/src/system.h +++ b/src/system.h @@ -79,6 +79,21 @@ extern int errno; #endif +/* AIX requires this to be the first thing in the file. */ +#ifndef __GNUC__ +# if HAVE_ALLOCA_H +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +#endif + #if PROTOTYPES # define PARAMS(p) p #else @@ -134,20 +149,9 @@ size_t strnlen PARAMS ((const char *s, size_t maxlen)); # define setlocale(Category, Locale) #endif -#ifdef ENABLE_NLS -# include -# define _(Text) gettext (Text) -#else -# undef bindtextdomain -# define bindtextdomain(Domain, Directory) -# undef textdomain -# define textdomain(Domain) -# undef ngettext -# define ngettext(Singular, Plural, Number) \ - ((Number == 1) ? Singular : Plural) -# define _(Text) Text -#endif -#define N_(Text) Text +#include "intl/libgettext.h" +#define _(Msgid) gettext (Msgid) +#define N_(Msgid) (Msgid) /*-------------------------------. @@ -279,6 +283,21 @@ do { \ #endif +/* As memcpy, but for shorts. */ +#define shortcpy(Dest, Src, Num) \ + memcpy (Dest, Src, Num * sizeof (short)) + +/* Free a linked list. */ +#define LIST_FREE(Type, List) \ +do { \ + Type *_node, *_next; \ + for (_node = List; _node; _node = _next) \ + { \ + _next = _node->next; \ + XFREE (_node); \ + } \ +} while (0) + /*---------------------------------. | Debugging the memory allocator. | `---------------------------------*/