[svn] gpgme - r1499 - trunk/src

svn author wk cvs at cvs.gnupg.org
Wed Nov 3 11:33:11 CET 2010


Author: wk
Date: 2010-11-03 11:33:10 +0100 (Wed, 03 Nov 2010)
New Revision: 1499

Modified:
   trunk/src/ChangeLog
   trunk/src/debug.c
   trunk/src/signers.c
   trunk/src/w32-ce.c
   trunk/src/w32-ce.h
   trunk/src/w32-util.c
Log:
Hopefully last changes for building with MSC.


Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2010-11-03 09:56:27 UTC (rev 1498)
+++ trunk/src/ChangeLog	2010-11-03 10:33:10 UTC (rev 1499)
@@ -1,10 +1,18 @@
 2010-11-03  Werner Koch  <wk at g10code.com>
 
+	* debug.c (_gpgme_debug) [W32CE]: Replace locatime by GetLocalTime.
+
+	* signers.c (gpgme_signers_clear): Remove useless return.
+	Reported by Patrick Spendrin.
+
+	* w32-util.c: s/__inline__/GPG_ERR_INLINE/
+
 	* setenv.c: Include string.h due to our strerror replacement.
 
-	* w32-ce.h (access): New macro.
+	* w32-ce.h (access, bsearch): New macros.
 	* w32-ce.c (_gpgme_wince_access): New.
 	(RegQueryValueExA): Change DATA to a void*.
+	(_gpgme_wince_bsearch): New.  Taken from glibc 2.6.
 
 	Guard include of sys/stat.h and sys/types.h.
 

Modified: trunk/src/debug.c
===================================================================
--- trunk/src/debug.c	2010-11-03 09:56:27 UTC (rev 1498)
+++ trunk/src/debug.c	2010-11-03 10:33:10 UTC (rev 1499)
@@ -209,6 +209,15 @@
   va_start (arg_ptr, format);
   LOCK (debug_lock);
   {
+#ifdef HAVE_W32CE_SYSTEM
+    SYSTEMTIME t;
+
+    GetLocalTime (&t);
+    fprintf (errfp, "GPGME %04d-%02d-%02d %02d:%02d:%02d <0x%04llx>  ",
+	     t.wYear, t.wMonth, t.wDay,
+	     t.wHour, t.wMinute, t.wSecond,
+	     (unsigned long long) ath_self ());
+#else
     struct tm *tp;
     time_t atime = time (NULL);
     
@@ -217,6 +226,7 @@
 	     1900+tp->tm_year, tp->tm_mon+1, tp->tm_mday,
 	     tp->tm_hour, tp->tm_min, tp->tm_sec,
 	     (unsigned long long) ath_self ());
+#endif
   }
 #ifdef FRAME_NR
   {

Modified: trunk/src/signers.c
===================================================================
--- trunk/src/signers.c	2010-11-03 09:56:27 UTC (rev 1498)
+++ trunk/src/signers.c	2010-11-03 10:33:10 UTC (rev 1499)
@@ -57,7 +57,7 @@
 gpgme_signers_clear (gpgme_ctx_t ctx)
 {
   TRACE (DEBUG_CTX, "gpgme_signers_clear", ctx);
-  return _gpgme_signers_clear (ctx);
+  _gpgme_signers_clear (ctx);
 }
 
 

Modified: trunk/src/w32-ce.c
===================================================================
--- trunk/src/w32-ce.c	2010-11-03 09:56:27 UTC (rev 1498)
+++ trunk/src/w32-ce.c	2010-11-03 10:33:10 UTC (rev 1499)
@@ -1,5 +1,6 @@
 /* w32-ce.h 
    Copyright (C) 2010 g10 Code GmbH
+   Copyright (C) 1991,92,97,2000,02 Free Software Foundation, Inc.
 
    This file is part of GPGME.
  
@@ -14,9 +15,8 @@
    Lesser General Public License for more details.
    
    You should have received a copy of the GNU Lesser General Public
-   License along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.  */
+   License along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -473,3 +473,35 @@
     }
   return 0;
 }
+
+
+/* Perform a binary search for KEY in BASE which has NMEMB elements
+   of SIZE bytes each.  The comparisons are done by (*COMPAR)().  
+   Code taken from glibc-2.6. */
+void *
+_gpgme_wince_bsearch (const void *key, const void *base,
+                      size_t nmemb, size_t size,
+                      int (*compar) (const void *, const void *))
+{
+  size_t l, u, idx;
+  const void *p;
+  int comparison;
+
+  l = 0;
+  u = nmemb;
+  while (l < u)
+    {
+      idx = (l + u) / 2;
+      p = (void *) (((const char *) base) + (idx * size));
+      comparison = (*compar) (key, p);
+      if (comparison < 0)
+	u = idx;
+      else if (comparison > 0)
+	l = idx + 1;
+      else
+	return (void *) p;
+    }
+
+  return NULL;
+}
+

Modified: trunk/src/w32-ce.h
===================================================================
--- trunk/src/w32-ce.h	2010-11-03 09:56:27 UTC (rev 1498)
+++ trunk/src/w32-ce.h	2010-11-03 10:33:10 UTC (rev 1499)
@@ -70,6 +70,11 @@
 int _gpgme_wince_access (const char *fname, int mode);
 #define access(a,b) _gpgme_wince_access ((a), (b))
 
+void *_gpgme_wince_bsearch (const void *key, const void *base,
+                            size_t nmemb, size_t size,
+                            int (*compar) (const void *, const void *));
+#define bsearch(a,b,c,d,e) _gpgme_wince_bsearch ((a),(b),(c),(d),(e)) 
 
 
+
 #endif /* GPGME_W32_CE_H */

Modified: trunk/src/w32-util.c
===================================================================
--- trunk/src/w32-util.c	2010-11-03 09:56:27 UTC (rev 1498)
+++ trunk/src/w32-util.c	2010-11-03 10:33:10 UTC (rev 1499)
@@ -76,14 +76,14 @@
 
 #define RTLD_LAZY 0
 
-static __inline__ void *
+static GPG_ERR_INLINE void *
 dlopen (const char * name, int flag)
 {
   void * hd = LoadLibrary (name);
   return hd;
 }
 
-static __inline__ void *
+static GPG_ERR_INLINE void *
 dlsym (void * hd, const char * sym)
 {
   if (hd && sym)
@@ -96,7 +96,7 @@
   return NULL;
 }
 
-static __inline__ int
+static GPG_ERR_INLINE int
 dlclose (void * hd)
 {
   if (hd)





More information about the Gnupg-commits mailing list