summaryrefslogtreecommitdiff
path: root/ext/etc/etc.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2022-09-21 10:03:30 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2022-09-21 11:44:09 +0900
commit437800d3b0bdacf30b82fff15dd5532fbf65c3ab (patch)
tree03a51e316c81d20a53917aed8f2ac9cb4ae533f9 /ext/etc/etc.c
parent45741918e1963fce3416b253712cfd4745368e7f (diff)
getenv: is in stdlib.h
getenv is a very basic function that has been in stdlib.h since ISO/IEC 9899:1990. There is absolutely zero need for us to redeclare. pty.c already includes stdlib.h out of the box so we need nothing.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6358
Diffstat (limited to 'ext/etc/etc.c')
-rw-r--r--ext/etc/etc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/etc/etc.c b/ext/etc/etc.c
index 4cd941f586..c355fe117a 100644
--- a/ext/etc/etc.c
+++ b/ext/etc/etc.c
@@ -47,8 +47,12 @@ static VALUE sGroup;
#define HAVE_UNAME 1
#endif
-#ifndef _WIN32
-char *getenv();
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
#endif
char *getlogin();