Move _putenv and _wputenv out of _POSIX_ guard. See http://msdn.microsoft.com/en-us/library/83zh4e6k.aspx for more details.
diff --git a/mingw-w64-headers/crt/stdlib.h b/mingw-w64-headers/crt/stdlib.h index 839cace..7743452 100644 --- a/mingw-w64-headers/crt/stdlib.h +++ b/mingw-w64-headers/crt/stdlib.h
@@ -520,6 +520,9 @@ __MINGW_EXTENSION _CRTIMP unsigned __int64 __cdecl _wcstoui64_l(const wchar_t *_Str ,wchar_t **_EndPtr,int _Radix,_locale_t _Locale); #endif + _CRTIMP int __cdecl _putenv(const char *_EnvString); + _CRTIMP int __cdecl _wputenv(const wchar_t *_EnvString); + #ifndef _POSIX_ #define _CVTBUFSIZE (309+40) _CRTIMP char *__cdecl _fullpath(char *_FullPath,const char *_Path,size_t _SizeInBytes); @@ -553,7 +556,6 @@ #define _CRT_PERROR_DEFINED void __cdecl perror(const char *_ErrMsg); #endif - _CRTIMP int __cdecl _putenv(const char *_EnvString); #pragma push_macro ("_rotr64") #pragma push_macro ("_rotl64") #undef _rotl64 @@ -583,7 +585,6 @@ #define _CRT_WPERROR_DEFINED _CRTIMP void __cdecl _wperror(const wchar_t *_ErrMsg); #endif - _CRTIMP int __cdecl _wputenv(const wchar_t *_EnvString); _CRTIMP void __cdecl _wsearchenv(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; _CRTIMP void __cdecl _wsplitpath(const wchar_t *_FullPath,wchar_t *_Drive,wchar_t *_Dir,wchar_t *_Filename,wchar_t *_Ext) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; #endif