From: Christos Zoulas Date: Thu, 3 Jul 2008 15:53:10 +0000 (+0000) Subject: more portability ifdefs X-Git-Tag: FILE5_05~366 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bd717dac89ed7636c063f13bd626162f29450afd;p=file more portability ifdefs --- diff --git a/src/funcs.c b/src/funcs.c index 21fc672a..1b1762de 100644 --- a/src/funcs.c +++ b/src/funcs.c @@ -36,9 +36,12 @@ #if defined(HAVE_WCTYPE_H) #include #endif +#if defined(HAVE_LIMITS_H) +#include +#endif #ifndef lint -FILE_RCSID("@(#)$File: funcs.c,v 1.42 2008/07/03 15:48:18 christos Exp $") +FILE_RCSID("@(#)$File: funcs.c,v 1.43 2008/07/03 15:53:10 christos Exp $") #endif /* lint */ #ifndef SIZE_MAX diff --git a/src/magic.c b/src/magic.c index efd1c0a2..78d40475 100644 --- a/src/magic.c +++ b/src/magic.c @@ -38,7 +38,9 @@ #ifdef QUICK #include #endif +#ifdef HAVE_LIMITS_H #include /* for PIPE_BUF */ +#endif #if defined(HAVE_UTIMES) # include @@ -63,7 +65,7 @@ #include "patchlevel.h" #ifndef lint -FILE_RCSID("@(#)$File: magic.c,v 1.51 2008/05/16 14:25:01 christos Exp $") +FILE_RCSID("@(#)$File: magic.c,v 1.52 2008/07/03 15:53:10 christos Exp $") #endif /* lint */ #ifndef PIPE_BUF diff --git a/src/vasprintf.c b/src/vasprintf.c index 5022f163..0289c0d8 100644 --- a/src/vasprintf.c +++ b/src/vasprintf.c @@ -105,8 +105,9 @@ A buffer overflow can only occur if your sprintf() do strange things or when you use strange formats. */ - +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include #include @@ -114,7 +115,9 @@ you use strange formats. #include #include #include +#ifdef HAVE_LIMITS_H #include +#endif #define ALLOC_CHUNK 2048 #define ALLOC_SECURITY_MARGIN 1024 /* big value because some platforms have very big 'G' exponent */