about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--stdlib/strtol.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/stdlib/strtol.c b/stdlib/strtol.c
index 42f7f24fe9..1d63bbeb2d 100644
--- a/stdlib/strtol.c
+++ b/stdlib/strtol.c
@@ -24,11 +24,18 @@ Cambridge, MA 02139, USA.  */
 #ifdef _LIBC
 # define USE_NUMBER_GROUPING
 # define STDC_HEADERS
+# define HAVE_LIMITS_H
 #endif
 
 #include <ctype.h>
 #include <errno.h>
-#include <limits.h>
+#ifndef errno
+extern int errno;
+#endif
+
+#if HAVE_LIMITS_H
+# include <limits.h>
+#endif
 
 #ifdef STDC_HEADERS
 # include <stddef.h>