[Commits] [SCM] claws branch, master, updated. 3.11.1-142-gc483d06

ticho at claws-mail.org ticho at claws-mail.org
Fri Jun 19 00:00:33 CEST 2015


The branch, master has been updated
       via  c483d06ee33be8a2112116c3156411d98ee717fc (commit)
      from  e7d7deb012e1d5550d2586bb34962ebd4d580055 (commit)

Summary of changes:
 src/common/Makefile.am  |    2 +-
 src/common/w32_dirent.c |  100 -----------------------------------------------
 src/common/w32_stdio.c  |    2 +
 src/common/w32_stdlib.c |    2 +
 src/common/w32_string.c |    3 +-
 src/common/w32_time.c   |    2 +
 src/common/w32lib.h     |   33 ++++++++++------
 src/ldaputil.h          |    3 ++
 8 files changed, 33 insertions(+), 114 deletions(-)
 delete mode 100644 src/common/w32_dirent.c


- Log -----------------------------------------------------------------
commit c483d06ee33be8a2112116c3156411d98ee717fc
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Thu Jun 18 23:58:51 2015 +0200

    Various small fix ups needed for mingw-w64 build.

diff --git a/src/common/Makefile.am b/src/common/Makefile.am
index 796fae3..1619226 100644
--- a/src/common/Makefile.am
+++ b/src/common/Makefile.am
@@ -10,7 +10,7 @@ noinst_LTLIBRARIES = libclawscommon.la
 
 if OS_WIN32
 arch_sources = fnmatch.c \
-               w32_dirent.c w32_reg.c w32_signal.c w32_stat.c \
+               w32_reg.c w32_signal.c w32_stat.c \
                w32_stdio.c w32_stdlib.c w32_string.c w32_time.c \
                w32_unistd.c w32_wait.c w32_account.c
 arch_headers = fnmatch.h w32lib.h
diff --git a/src/common/w32_dirent.c b/src/common/w32_dirent.c
deleted file mode 100644
index 91539dc..0000000
--- a/src/common/w32_dirent.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/* w32_dirent.c  - Posix emulation layer for Sylpheed (Claws)
- *
- * This file is part of w32lib.
- *
- * 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 3 of the License, or
- * (at your option) any later version.
- *
- * w32lib is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * 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, see <http://www.gnu.org/licenses/>.
- *
- * For more information and a list of changes, see w32lib.h
- */
-
-
-#include <stdlib.h>
-#include <string.h>
-#include <windows.h>
-#include <dirent.h>
-
-#include "w32lib.h"
-
-
-
-DIR *
-opendir ( const char *name )
-{
-  DIR *dir;
-  
-  dir = calloc (1, sizeof *dir + strlen (name));
-  if (!dir)
-    return NULL;
-  strcpy (dir->dd_name, name);
-  return dir;
-}
-
-int 
-closedir (DIR *dir)
-{
-  FindClose( (HANDLE)dir->dd_handle );
-  free( dir );
-  return 0;
-}
-
-struct dirent *
-readdir( DIR *dir )
-{
-  WIN32_FIND_DATA fInfo;
-  struct dirent *xdirent;
-  int ret;
-  
-  if ( !dir->dd_handle )
-    {
-      char *dirname;
-      
-      if (*dir->dd_name) 
-        {
-          size_t n = strlen (dir->dd_name);
-          dirname = malloc (n + 4 + 1);
-          if (dirname) {
-            strcpy (dirname, dir->dd_name);
-            strcpy (dirname + n, "\\*.*");
-          }
-        }
-      else
-        dirname = strdup( "\\*.*" );
-      if (!dirname)
-        return NULL; /* Error. */
-
-      dir->dd_handle = (long)FindFirstFile( dirname, &fInfo );
-      free( dirname );
-      if ( !dir->dd_handle )
-        ret = 0;
-      else
-        ret = 1;
-    } 
-  else if ( dir->dd_handle != -1l )
-    {
-        ret = FindNextFile ((HANDLE)dir->dd_handle, &fInfo);
-    }
-  else
-    ret = 0;
-  if ( !ret ) 
-    return NULL;
-
-  xdirent = calloc ( 1, sizeof *xdirent);
-  if (xdirent)
-    {
-      strncpy (xdirent->d_name, fInfo.cFileName, FILENAME_MAX -1 );
-      xdirent->d_name[FILENAME_MAX-1] = 0;
-      xdirent->d_namlen = strlen( xdirent->d_name );
-    }
-  return xdirent;
-}
diff --git a/src/common/w32_stdio.c b/src/common/w32_stdio.c
index 50b51c0..af6a3ed 100644
--- a/src/common/w32_stdio.c
+++ b/src/common/w32_stdio.c
@@ -23,9 +23,11 @@
 
 #include "w32lib.h"
 
+#if MINGW64_VERSION < 200
 FILE *popen( const char *command, const char *type ){
   return NULL;
 }
+#endif
 
 int pclose( FILE *stream ){
   return -1;
diff --git a/src/common/w32_stdlib.c b/src/common/w32_stdlib.c
index 3aba8f9..a55a17e 100644
--- a/src/common/w32_stdlib.c
+++ b/src/common/w32_stdlib.c
@@ -31,6 +31,8 @@ void srandom( unsigned int seed ){
   srand( seed );
 }
 
+#if MINGW64_VERSION < 200
 int truncate( const char *path, off_t length ){
   return -1;
 }
+#endif
diff --git a/src/common/w32_string.c b/src/common/w32_string.c
index 8bc0a1d..6c238e3 100644
--- a/src/common/w32_string.c
+++ b/src/common/w32_string.c
@@ -24,6 +24,7 @@
 
 #include "w32lib.h"
 
+#if MINGW64_VERSION < 200
 int strcasecmp( const char *s1, const char *s2 ){
   size_t len1, len2, len;
 
@@ -49,4 +50,4 @@ int strncasecmp( const char *s1, const char *s2, size_t n ){
 
    return 0;
 }
-
+#endif /* MINGW64_VERSION < 200 */
diff --git a/src/common/w32_time.c b/src/common/w32_time.c
index c7bb43f..ef7df8f 100644
--- a/src/common/w32_time.c
+++ b/src/common/w32_time.c
@@ -25,6 +25,7 @@
 #include "w32lib.h"
 
 #if ! defined (__MINGW32__) || MINGW32_VERSION < 312
+# if MINGW64_VERSION < 200
 int gettimeofday( struct timeval *tv, struct timezone *tz ){
   struct _timeb tstruct;
   _ftime( &tstruct );
@@ -32,4 +33,5 @@ int gettimeofday( struct timeval *tv, struct timezone *tz ){
   tv->tv_usec = tstruct.millitm;
   return 1;
 }
+# endif
 #endif
diff --git a/src/common/w32lib.h b/src/common/w32lib.h
index fb7b923..cfa8e53 100644
--- a/src/common/w32lib.h
+++ b/src/common/w32lib.h
@@ -76,13 +76,18 @@
 #include <stdio.h>
 
 #ifdef __MINGW32__
-#include <_mingw.h>
-#define MINGW32_VERSION (__MINGW32_MAJOR_VERSION * 100 \
+# include <_mingw.h>
+# define MINGW32_VERSION (__MINGW32_MAJOR_VERSION * 100 \
 			 + __MINGW32_MINOR_VERSION)
-#include <wchar.h>
-#include <dirent.h>
-#include <sys/time.h>
-#endif
+# define MINGW64_VERSION (__MINGW64_VERSION_MAJOR * 100 \
+			 + __MINGW64_VERSION_MINOR)
+# include <wchar.h>
+# include <dirent.h>
+# include <sys/time.h>
+# if MINGW64_VERSION >= 200
+#  include <sys/types.h>
+# endif
+#endif /* __MINGW32__ */
 
 #include <glib/gstdio.h>
 
@@ -125,9 +130,10 @@ typedef unsigned int uid_t;
 
 /* functions */
 /*** str ***/
+#if MINGW64_VERSION < 200
 int strcasecmp( const char *s1, const char *s2 );
-
 int strncasecmp( const char *s1, const char *s2, size_t n );
+#endif
 
 /*** dir ***/
 #ifndef __MINGW32__
@@ -163,16 +169,13 @@ typedef struct
 
 #endif /* !__MINGW32__ */
 
-
-DIR *opendir( const char *name );
-int closedir( DIR *dir );
-struct dirent *readdir( DIR *dir );
-
 #if defined (__MINGW32__) && MINGW32_VERSION < 312
+# if MINGW64_VERSION < 200
 struct timezone {
   int tz_minuteswest;
   int tz_dsttime;
 };
+# endif
 #endif
 
 /*** stat ***/
@@ -183,7 +186,9 @@ pid_t waitpid( pid_t pid, int *status, int options );
 
 /*** sys/time ***/
 #if ! defined (__MINGW32__) || MINGW32_VERSION < 312
+# if MINGW64_VERSION < 200
 int gettimeofday( struct timeval *tv, struct timezone *tz );
+# endif
 #endif
 
 /*** unistd ***/
@@ -195,14 +200,18 @@ unsigned int sleep( unsigned int seconds );
 /*** stdlib ***/
 long int random( void );
 void srandom( unsigned int seed );
+#if MINGW64_VERSION < 200
 int truncate( const char *path, off_t length );
+#endif
 
 /*** signal ***/
 int kill( pid_t pid, int sig );
 
 /*** stdio ***/
+#if MINGW64_VERSION < 200
 FILE *popen( const char *command, const char *type );
 int pclose( FILE *stream );
+#endif
 
 /*** w32_account.c ***/
 int w32_is_administrator (void);
diff --git a/src/ldaputil.h b/src/ldaputil.h
index b9eded5..0c711ca 100644
--- a/src/ldaputil.h
+++ b/src/ldaputil.h
@@ -37,6 +37,9 @@
 #define ldap_unbind_ext(ld,x,y) ldap_unbind_s(ld)
 #define LDAP_ADMINLIMIT_EXCEEDED LDAP_ADMIN_LIMIT_EXCEEDED
 #define timeval l_timeval
+#ifndef LDAP_OPT_SUCCESS
+# define LDAP_OPT_SUCCESS 0
+#endif
 #endif
 /* Function Prototypes */
 GList *ldaputil_read_basedn	( const gchar *host, const gint port,

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list