More include guards.
Provide access for Wince. Install dummy sehmap.h
This commit is contained in:
parent
753375ffcf
commit
21eb91ae3a
@ -1,3 +1,8 @@
|
||||
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.
|
||||
|
@ -774,7 +774,7 @@ AC_CHECK_FUNCS(getgid getegid)
|
||||
# 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.
|
||||
|
@ -1,3 +1,7 @@
|
||||
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.
|
||||
|
@ -219,15 +219,21 @@ copy-static-source:
|
||||
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:
|
||||
|
@ -1,3 +1,13 @@
|
||||
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.
|
||||
|
@ -33,7 +33,9 @@
|
||||
# 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
|
||||
@ -60,7 +62,6 @@ ath_self (void)
|
||||
}
|
||||
#else
|
||||
# ifdef __linux
|
||||
#include <sys/types.h>
|
||||
#include <sys/syscall.h>
|
||||
uintptr_t
|
||||
ath_self (void)
|
||||
|
@ -40,7 +40,9 @@
|
||||
# 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*/
|
||||
|
@ -25,8 +25,10 @@
|
||||
|
||||
#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>
|
||||
|
||||
|
@ -26,7 +26,9 @@
|
||||
#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"
|
||||
|
@ -25,7 +25,9 @@
|
||||
#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"
|
||||
|
@ -23,7 +23,9 @@
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#include "debug.h"
|
||||
#include "data.h"
|
||||
|
@ -22,7 +22,9 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
|
||||
#include "debug.h"
|
||||
|
@ -25,7 +25,9 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
|
||||
#include "gpgme.h"
|
||||
|
@ -33,9 +33,13 @@
|
||||
#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>
|
||||
|
||||
|
@ -30,7 +30,9 @@
|
||||
|
||||
#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>
|
||||
|
@ -25,7 +25,9 @@
|
||||
|
||||
#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>
|
||||
|
@ -24,7 +24,9 @@
|
||||
|
||||
#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>
|
||||
|
@ -26,7 +26,9 @@
|
||||
|
||||
#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>
|
||||
|
@ -29,7 +29,9 @@
|
||||
|
||||
#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>
|
||||
|
@ -28,8 +28,12 @@
|
||||
#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>
|
||||
|
@ -25,8 +25,10 @@
|
||||
#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>
|
||||
|
@ -52,7 +52,9 @@
|
||||
# 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
|
||||
|
@ -34,7 +34,9 @@
|
||||
#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>
|
||||
|
@ -35,7 +35,9 @@
|
||||
#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"
|
||||
|
@ -32,7 +32,9 @@
|
||||
#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
|
||||
|
@ -20,6 +20,7 @@
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <gpg-error.h>
|
||||
#define __set_errno(ev) (gpg_err_set_errno (ev))
|
||||
|
||||
|
@ -31,7 +31,9 @@
|
||||
#endif
|
||||
|
||||
/* For pid_t. */
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#include "gpgme.h"
|
||||
|
||||
|
34
src/w32-ce.c
34
src/w32-ce.c
@ -290,7 +290,7 @@ RegQueryValueExA (HKEY hKey, LPCSTR lpValueName, LPDWORD lpReserved,
|
||||
{
|
||||
wchar_t *name;
|
||||
LONG err;
|
||||
BYTE *data;
|
||||
void *data;
|
||||
DWORD data_len;
|
||||
DWORD type;
|
||||
|
||||
@ -335,8 +335,8 @@ RegQueryValueExA (HKEY hKey, LPCSTR lpValueName, LPDWORD lpReserved,
|
||||
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)
|
||||
@ -445,3 +445,31 @@ SHGetSpecialFolderPathA (HWND hwndOwner, LPSTR lpszPath, int nFolder,
|
||||
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;
|
||||
}
|
||||
|
@ -67,5 +67,9 @@ DWORD GetTempPathA(DWORD,LPSTR);
|
||||
#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 */
|
||||
|
@ -34,7 +34,9 @@
|
||||
#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>
|
||||
|
@ -31,7 +31,9 @@
|
||||
#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"
|
||||
|
@ -31,7 +31,9 @@
|
||||
#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"
|
||||
|
@ -32,8 +32,12 @@
|
||||
#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
|
||||
@ -104,7 +108,6 @@ dlclose (void * hd)
|
||||
}
|
||||
#endif /* HAVE_ALLOW_SET_FOREGROUND_WINDOW */
|
||||
|
||||
|
||||
void
|
||||
_gpgme_allow_set_foreground_window (pid_t pid)
|
||||
{
|
||||
|
@ -26,7 +26,9 @@
|
||||
#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"
|
||||
|
Loading…
Reference in New Issue
Block a user