aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2010-11-03 10:33:10 +0000
committerWerner Koch <[email protected]>2010-11-03 10:33:10 +0000
commit83d88d444eef15e128dd4080d6b1978b4d8657c2 (patch)
tree3dd805f4b85a230cb4ed86d79625b43f99a47a42
parentMore include guards. (diff)
downloadgpgme-83d88d444eef15e128dd4080d6b1978b4d8657c2.tar.gz
gpgme-83d88d444eef15e128dd4080d6b1978b4d8657c2.zip
Hopefully last changes for building with MSC.
-rw-r--r--src/ChangeLog10
-rw-r--r--src/debug.c10
-rw-r--r--src/signers.c2
-rw-r--r--src/w32-ce.c38
-rw-r--r--src/w32-ce.h5
-rw-r--r--src/w32-util.c6
6 files changed, 63 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 207647ec..53de1f5d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,10 +1,18 @@
2010-11-03 Werner Koch <[email protected]>
+ * 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.
diff --git a/src/debug.c b/src/debug.c
index 1d9a40eb..34c5d18f 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -209,6 +209,15 @@ _gpgme_debug (int level, const char *format, ...)
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 @@ _gpgme_debug (int level, const char *format, ...)
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
{
diff --git a/src/signers.c b/src/signers.c
index 021a878d..ae74e815 100644
--- a/src/signers.c
+++ b/src/signers.c
@@ -57,7 +57,7 @@ void
gpgme_signers_clear (gpgme_ctx_t ctx)
{
TRACE (DEBUG_CTX, "gpgme_signers_clear", ctx);
- return _gpgme_signers_clear (ctx);
+ _gpgme_signers_clear (ctx);
}
diff --git a/src/w32-ce.c b/src/w32-ce.c
index b7dfc38b..88a8f316 100644
--- a/src/w32-ce.c
+++ b/src/w32-ce.c
@@ -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 @@ _gpgme_wince_access (const char *fname, int mode)
}
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;
+}
+
diff --git a/src/w32-ce.h b/src/w32-ce.h
index 2bc34ca7..9be361f7 100644
--- a/src/w32-ce.h
+++ b/src/w32-ce.h
@@ -70,6 +70,11 @@ BOOL SHGetSpecialFolderPathA(HWND,LPSTR,int,BOOL);
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 */
diff --git a/src/w32-util.c b/src/w32-util.c
index 532f89e9..50052dee 100644
--- a/src/w32-util.c
+++ b/src/w32-util.c
@@ -76,14 +76,14 @@ DEFINE_STATIC_LOCK (get_path_lock);
#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 @@ dlsym (void * hd, const char * sym)
return NULL;
}
-static __inline__ int
+static GPG_ERR_INLINE int
dlclose (void * hd)
{
if (hd)