kFreeBSD portability fix.
+2010-10-07 Werner Koch <wk@g10code.com>
+
+ * gpgme-tool.c (ARGP_ERR_UNKNOWN): Use EDEADLK if available.
+
+ * w32-util.c (_gpgme_w32ce_get_debug_envvar) [W32CE]: New.
+ * debug.c (debug_init) [W32CE]: Use new function.
+
2010-09-16 Werner Koch <wk@g10code.com>
* import.c: Include "util.h".
char *e;
const char *s1, *s2;;
+#ifdef HAVE_W32CE_SYSTEM
+ e = _gpgme_w32ce_get_debug_envvar ();
+#else /*!HAVE_W32CE_SYSTEM*/
err = _gpgme_getenv ("GPGME_DEBUG", &e);
if (err)
{
UNLOCK (debug_lock);
return;
}
+#endif /*!HAVE_W32CE_SYSTEM*/
initialized = 1;
errfp = stderr;
void *pstate;
};
-#define ARGP_ERR_UNKNOWN EDEADLOCK
+#ifdef EDEADLK
+# define ARGP_ERR_UNKNOWN EDEADLK /* POSIX */
+#else
+# define ARGP_ERR_UNKNOWN EDEADLOCK /* *GNU/kFreebsd does not define this) */
+#endif
#define ARGP_KEY_ARG 0
#define ARGP_KEY_ARGS 0x1000006
#define ARGP_KEY_END 0x1000001
#ifdef HAVE_W32_SYSTEM
int _gpgme_mkstemp (int *fd, char **name);
const char *_gpgme_get_w32spawn_path (void);
-#endif
+#endif /*HAVE_W32_SYSTEM*/
+#ifdef HAVE_W32CE_SYSTEM
+char *_gpgme_w32ce_get_debug_envvar (void);
+#endif /*HAVE_W32CE_SYSTEM*/
/*-- Error codes not yet available in current gpg-error.h. --*/
#ifndef GPG_ERR_UNFINISHED
*name = tmpname;
return 0;
}
+
+
+\f
+#ifdef HAVE_W32CE_SYSTEM
+/* Return a malloced string with the replacement value for the
+ GPGME_DEBUG envvar. Caller must release. Returns NULL if not
+ set. */
+char *
+_gpgme_w32ce_get_debug_envvar (void)
+{
+ char *tmp;
+
+ tmp = w32_read_registry (L"\\Software\\GNU\\gpgme", L"debug");
+ if (tmp && !*tmp)
+ {
+ free (tmp);
+ tmp = NULL;
+ }
+ return NULL;
+}
+#endif /*HAVE_W32CE_SYSTEM*/