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 +#else +# ifdef HAVE_STDLIB_H +# include +# endif #endif char *getlogin(); diff --git a/ext/pty/pty.c b/ext/pty/pty.c index 155d215942..acec33f9bf 100644 --- a/ext/pty/pty.c +++ b/ext/pty/pty.c @@ -170,7 +170,7 @@ establishShell(int argc, VALUE *argv, struct pty_info *info, { int master, slave, status = 0; rb_pid_t pid; - char *p, *getenv(); + char *p; VALUE v; struct child_info carg; char errbuf[32];