From b15d33e108f8e402bcd60b6efafdb11089ceff09 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 27 Aug 1998 04:15:12 +0000 Subject: snprintf.c git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- missing/snprintf.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/missing/snprintf.c b/missing/snprintf.c index 68951c3d87..750372e6f7 100644 --- a/missing/snprintf.c +++ b/missing/snprintf.c @@ -59,24 +59,36 @@ #include - -# undef __P +#undef __P #if defined(__STDC__) -# define __P(x) x # include # if !defined(__P) # define __P(x) x # endif #else -# undef __P # define __P(x) () -# define const +# if !defined(const) +# define const +# endif # include #endif #ifndef _BSD_VA_LIST_ #define _BSD_VA_LIST_ va_list #endif +#ifdef __STDC__ +# include +#else +# ifndef LONG_MAX +# ifdef HAVE_LIMITS_H +# include +# else + /* assuming 32bit(2's compliment) long */ +# define LONG_MAX 2147483647 +# endif +# endif +#endif + #if defined(__hpux) && !defined(__GNUC__) #define const #endif @@ -359,22 +371,13 @@ err: #define u_short unsigned short #define u_int unsigned int -#if !defined(__CYGWIN32__) && (defined(__hpux) && !defined(__GNUC__)) +#if !defined(__CYGWIN32__) && defined(__hpux) && !defined(__GNUC__) #include #endif #if defined(__hpux) && !defined(__GNUC__) #include #endif -#if defined(__STDC__) -# include -#else -# include -# undef __P -# define __P(x) () -#endif - - /* * Flush out all the vectors defined by the given uio, * then reset it so that it can be reused. -- cgit v1.2.3