Provide access for Wince.
Install dummy sehmap.h
+2010-11-03 Werner Koch <wk@g10code.com>
+
+ * configure.ac (AC_CHECK_HEADERS): Check for sys/types.h and
+ sys.stat.h.
+
2010-11-02 Werner Koch <wk@g10code.com>
* configure.ac (AC_CHECK_HEADERS): Check for sys.time.h.
# Replacement functions.
AC_REPLACE_FUNCS(stpcpy)
# Check for unistd.h for setenv replacement function.
-AC_CHECK_HEADERS([unistd.h sys/time.h])
+AC_CHECK_HEADERS([unistd.h sys/time.h sys/types.h sys/stat.h])
AC_REPLACE_FUNCS(setenv)
# Assuan check for descriptor passing.
+2010-11-03 Werner Koch <wk@g10code.com>
+
+ * conf-w32ce-msc/build.mk (copy-built-source): Create dummy sehmap.h.
+
2010-11-01 Werner Koch <wk@g10code.com>
* conf-w32ce-msc/config.h: New.
cd ../contrib/conf-w32ce-msc ; \
cp -t $(targetsrc)/gpgme/src $(conf_sources)
-
+# We create a dummy sehmap.h which will be included first due to -I. .
+# For some reasons sehmap.h is included by MSC for WindowsCE and
+# introduces a macro "leave" which conflicts of our use of "leave" for
+# a label (leave and enter are pretty common names for pro- and epilog
+# code).
copy-built-source:
@if [ ! -f ./gpgme.h ]; then \
echo "Please build using ./autogen.sh --build-w32ce first"; \
exit 1; \
fi
cp -t $(targetsrc)/gpgme/src $(built_sources)
+ echo '/* Dummy replacement for useless header. */' \
+ > $(targetsrc)/gpgme/src/sehmap.h
-copy-source: copy-static-source copy-built-source
+copy-source: copy-static-source copy-built-source
.c.obj:
+2010-11-03 Werner Koch <wk@g10code.com>
+
+ * setenv.c: Include string.h due to our strerror replacement.
+
+ * w32-ce.h (access): New macro.
+ * w32-ce.c (_gpgme_wince_access): New.
+ (RegQueryValueExA): Change DATA to a void*.
+
+ Guard include of sys/stat.h and sys/types.h.
+
2010-11-02 Werner Koch <wk@g10code.com>
* data-fd.c (read, write, lseek) [W32CE && ! __MINGW32CE__]: New.
# include <sys/time.h>
# endif
#endif
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#ifndef HAVE_W32_SYSTEM
#include <sys/wait.h>
#endif
}
#else
# ifdef __linux
-#include <sys/types.h>
#include <sys/syscall.h>
uintptr_t
ath_self (void)
# include <sys/time.h>
# endif
# endif
-# include <sys/types.h>
+# ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+# endif
# include <sys/socket.h>
#endif /*!HAVE_W32_SYSTEM*/
#include <stdlib.h>
#include <string.h>
-/* Solaris 8 needs sys/types.h before time.h. */
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+ /* Solaris 8 needs sys/types.h before time.h. */
+# include <sys/types.h>
+#endif
#include <time.h>
#include <errno.h>
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
-#include <sys/stat.h>
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
#include <stdlib.h>
#include "data.h"
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#include "debug.h"
#include "data.h"
#endif
#include <stdio.h>
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#include "debug.h"
#include "data.h"
#include <config.h>
#endif
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#include <errno.h>
#include "debug.h"
#include <config.h>
#endif
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#include <limits.h>
#include "gpgme.h"
#include <errno.h>
#include <time.h>
#ifndef HAVE_DOSISH_SYSTEM
+# ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
+# endif
+# ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
-# include <fcntl.h>
+# endif
+# include <fcntl.h>
#endif
#include <assert.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#include <assert.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#include <assert.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#include <assert.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#include <assert.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#include <assert.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#include <fcntl.h>
#include <ctype.h>
#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
#include <stdint.h>
#include <process.h>
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-/* Solaris 8 needs sys/types.h before time.h. */
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+ /* Solaris 8 needs sys/types.h before time.h. */
+# include <sys/types.h>
+#endif
#include <time.h>
#include <assert.h>
#include <ctype.h>
# define LONG_MAX LONG_MAX_32_BITS
#endif
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#undef __memrchr
#undef memrchr
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#include <sys/wait.h>
#ifdef HAVE_SYS_UIO_H
# include <sys/uio.h>
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#include "util.h"
#include "sema.h"
#endif
/* For pid_t. */
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
/* A single file descriptor passed to spawn. For child fds, dup_to
# include <config.h>
#endif
+#include <string.h>
#include <gpg-error.h>
#define __set_errno(ev) (gpg_err_set_errno (ev))
#endif
/* For pid_t. */
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#include "gpgme.h"
{
wchar_t *name;
LONG err;
- BYTE *data;
+ void *data;
DWORD data_len;
DWORD type;
int data_c_len;
/* This is valid since we allocated one more above. */
- data[data_len] = '\0';
- data[data_len + 1] = '\0';
+ ((char*)data)[data_len] = '\0';
+ ((char*)data)[data_len + 1] = '\0';
data_c = wchar_to_utf8 ((wchar_t*) data);
if (!data_c)
lpszPath[MAX_PATH - 1] = '\0';
return result;
}
+
+/* Replacement for the access function. Note that we can't use fopen
+ here because wince might now allow to have a shared read for an
+ executable; it is better to to read the file attributes.
+
+ Limitation: Only F_OK is supported.
+*/
+int
+_gpgme_wince_access (const char *fname, int mode)
+{
+ DWORD attr;
+ wchar_t *wfname;
+
+ (void)mode;
+
+ wfname = utf8_to_wchar (fname);
+ if (!wfname)
+ return -1;
+
+ attr = GetFileAttributes (wfname);
+ free (wfname);
+ if (attr == (DWORD)(-1))
+ {
+ gpg_err_set_errno (ENOENT);
+ return -1;
+ }
+ return 0;
+}
#define SHGetSpecialFolderPathA _gpgme_wince_SHGetSpecialFolderPathA
BOOL SHGetSpecialFolderPathA(HWND,LPSTR,int,BOOL);
+int _gpgme_wince_access (const char *fname, int mode);
+#define access(a,b) _gpgme_wince_access ((a), (b))
+
+
#endif /* GPGME_W32_CE_H */
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#include <glib.h>
#include <windows.h>
#include <io.h>
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#include <io.h>
#include "util.h"
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#include <io.h>
#include "util.h"
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
-#include <sys/types.h>
-#include <sys/stat.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
}
#endif /* HAVE_ALLOW_SET_FOREGROUND_WINDOW */
-
void
_gpgme_allow_set_foreground_window (pid_t pid)
{
#include <string.h>
#include <assert.h>
#include <errno.h>
-#include <sys/types.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
#include "util.h"
#include "context.h"