X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/300f275f23b65c09f69a437c635c48ddd126f21a..e9f87b5b7df2e328d2e4196d276c0d96594c906b:/src/system.h?ds=sidebyside diff --git a/src/system.h b/src/system.h index b8a73edb..b1d15424 100644 --- a/src/system.h +++ b/src/system.h @@ -1,5 +1,5 @@ /* system-dependent definitions for Bison. - Copyright 2000 Free Software Foundation, Inc. + Copyright 2000, 2001 Free Software Foundation, Inc. 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 @@ -26,16 +26,6 @@ #include -#ifdef MSDOS -# include -#endif - -#ifdef _MSC_VER -# include -# include -# define getpid _getpid -#endif - #if HAVE_STDLIB_H # include #endif @@ -62,9 +52,6 @@ # if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) # include # endif /* not STDC_HEADERS and HAVE_MEMORY_H */ -# ifndef bcopy -# define bcopy(src, dst, num) memcpy((dst), (src), (num)) -# endif #else /* not STDC_HEADERS and not HAVE_STRING_H */ # include /* memory.h and strings.h conflict on some systems. */ @@ -79,6 +66,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 @@ -87,6 +89,9 @@ extern int errno; # include "xalloc.h" +/* From xstrndup.c. */ +char *xstrndup PARAMS ((const char *s, size_t n)); + /*---------------------. | Missing prototypes. | `---------------------*/ @@ -95,14 +100,26 @@ extern int errno; char *stpcpy PARAMS ((char *dest, const char *src)); #endif +#if !HAVE_DECL_STRCHR +char *strchr(const char *s, int c); +#endif + #if !HAVE_DECL_STRNDUP char *strndup PARAMS ((const char *s, size_t size)); #endif +#if !HAVE_DECL_STRSPN +size_t strspn(const char *s, const char *accept); +#endif + #if !HAVE_DECL_STRNLEN size_t strnlen PARAMS ((const char *s, size_t maxlen)); #endif +#if !HAVE_DECL_MEMCHR +void *memchr(const void *s, int c, size_t n); +#endif + /*-----------------. @@ -134,20 +151,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 "libgettext.h" +#define _(Msgid) gettext (Msgid) +#define N_(Msgid) (Msgid) /*-------------------------------. @@ -303,4 +309,4 @@ do { \ # include # endif /* WITH_DMALLOC */ -#endif /* BISON_SYSTEM_H */ +#endif /* ! BISON_SYSTEM_H */