]> granicus.if.org Git - file/commitdiff
more portability ifdefs
authorChristos Zoulas <christos@zoulas.com>
Thu, 3 Jul 2008 15:53:10 +0000 (15:53 +0000)
committerChristos Zoulas <christos@zoulas.com>
Thu, 3 Jul 2008 15:53:10 +0000 (15:53 +0000)
src/funcs.c
src/magic.c
src/vasprintf.c

index 21fc672abd63f6898a1f09764c3dc32f218a51ac..1b1762de52318f16cb6bcfbeea60ec145bc5507c 100644 (file)
 #if defined(HAVE_WCTYPE_H)
 #include <wctype.h>
 #endif
+#if defined(HAVE_LIMITS_H)
+#include <limits.h>
+#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
index efd1c0a218c6970b13f3e7f4dad6461556b8d973..78d404753ca683aa0dbfaeddd6de5aacd983b969 100644 (file)
@@ -38,7 +38,9 @@
 #ifdef QUICK
 #include <sys/mman.h>
 #endif
+#ifdef HAVE_LIMITS_H
 #include <limits.h>    /* for PIPE_BUF */
+#endif
 
 #if defined(HAVE_UTIMES)
 # include <sys/time.h>
@@ -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 
index 5022f1634ee25755e58db940e28188130231da41..0289c0d88b4f1342a73bf296e832f39bfba5226e 100644 (file)
@@ -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 <assert.h>
 #include <stdio.h>
@@ -114,7 +115,9 @@ you use strange formats.
 #include <stdlib.h>
 #include <stdarg.h>
 #include <ctype.h>
+#ifdef HAVE_LIMITS_H
 #include <limits.h>
+#endif
 
 #define ALLOC_CHUNK 2048
 #define ALLOC_SECURITY_MARGIN 1024   /* big value because some platforms have very big 'G' exponent */