]> 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 c32b7825afabec243933366abf18b78956ec874c..5a044afd0f3267e528fe6d596f8e9b563ff2815f 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.41 2008/05/16 14:25:01 christos Exp $")
+FILE_RCSID("@(#)$File: funcs.c,v 1.42 2008/07/03 15:48:18 christos Exp $")
 #endif /* lint */
 
 #ifndef SIZE_MAX
index 0293bdefc6a8094d0f2efc23d8746ea7c1a84002..e23f7c2ab0fc08df85c13b907995c731b7f0af94 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.50 2008/02/19 00:58:59 rrt Exp $")
+FILE_RCSID("@(#)$File: magic.c,v 1.51 2008/05/16 14:25:01 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 */