2007-12-06 [colin] 3.1.0cvs63
[claws.git] / src / common / w32lib.h
index d77d058d9c10495b87b825599aabe47bc2744df0..6df909c3af3965fb9f3f0a4f0b893fb02428c0d0 100644 (file)
@@ -4,7 +4,7 @@
  *
  * 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,
@@ -13,9 +13,7 @@
  * 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
@@ -164,7 +166,7 @@ DIR *opendir( const char *name );
 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;
@@ -178,7 +180,9 @@ int lstat( const char *file_name, struct stat *buf );
 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 );