*
* w32lib is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* w32lib is distributed in the hope that it will be useful,
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- * USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* The code has been taken from the package
* http://claws.sylpheed.org/win32/sylpheed/w32lib-dev-2004.2.3.0.zip
#include <stdio.h>
#ifdef __MINGW32__
+#include <_mingw.h>
+#define MINGW32_VERSION (__MINGW32_MAJOR_VERSION * 100 \
+ + __MINGW32_MINOR_VERSION)
#include <wchar.h>
#include <dirent.h>
+#include <sys/time.h>
#endif
/* Mingw32 3.4.4 defines interface to struct and thus breaks our own
int closedir( DIR *dir );
struct dirent *readdir( DIR *dir );
-#ifdef __MINGW32__
+#if defined (__MINGW32__) && MINGW32_VERSION < 312
struct timezone {
int tz_minuteswest;
int tz_dsttime;
pid_t waitpid( pid_t pid, int *status, int options );
/*** sys/time ***/
+#if ! defined (__MINGW32__) || MINGW32_VERSION < 312
int gettimeofday( struct timeval *tv, struct timezone *tz );
+#endif
/*** unistd ***/
uid_t getuid( void );