Builds again for W32.

This commit is contained in:
Werner Koch 2010-03-15 13:08:51 +00:00
parent fb2ba98963
commit 0f4eefb094
8 changed files with 39 additions and 17 deletions

View File

@ -123,7 +123,8 @@ if [ "$myhost" = "w32" ]; then
--with-zlib=${w32root} \
--with-regex=${w32root} \
--with-pth-prefix=${w32root} \
--with-adns=${w32root} "$@"
--with-adns=${w32root} \
--disable-g13 "$@"
rc=$?
exit $rc
fi

View File

@ -1,3 +1,12 @@
2010-03-15 Werner Koch <wk@g10code.com>
* logging.c (S_IRGRP, S_IROTH, S_IWGRP, S_IWOTH) [W32]: New.
(fun_writer, set_file_fd) [W32]: Disable socket code.
* localename.c: Include gpg-error.h.
* util.h (GPG_ERR_NOT_ENABLED): Remove this temporary definition.
2010-03-12 Werner Koch <wk@g10code.com>
* status.h (STATUS_ENTER): New.

View File

@ -29,6 +29,7 @@
#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif
#include <gpg-error.h> /* We need gettext_localename for W32. */
#include "../common/w32help.h"
@ -101,7 +102,7 @@ gnupg_messages_locale_name (void)
const char *s;
#ifdef HAVE_W32_SYSTEM
/* We use the localname function from ../common/w32-gettext.c. */
/* We use the localename function libgpg-error. */
s = gettext_localename ();
#else
s = do_nl_locale_name (LC_MESSAGES, "LC_MESSAGES");

View File

@ -30,19 +30,27 @@
#include <sys/types.h>
#include <sys/stat.h>
#ifndef HAVE_W32_SYSTEM
#include <sys/socket.h>
#include <sys/un.h>
#endif /*!HAVE_W32_SYSTEM*/
# include <sys/socket.h>
# include <sys/un.h>
#endif /*HAVE_W32_SYSTEM*/
#include <unistd.h>
#include <fcntl.h>
#include <assert.h>
#define JNLIB_NEED_LOG_LOGV 1
#define JNLIB_NEED_AFLOCAL 1
#include "libjnlib-config.h"
#include "logging.h"
#ifdef HAVE_W32_SYSTEM
# define S_IRGRP S_IRUSR
# define S_IROTH S_IRUSR
# define S_IWGRP S_IWUSR
# define S_IWOTH S_IWUSR
#endif
static estream_t logstream;
static int log_socket = -1;
@ -121,6 +129,7 @@ fun_writer (void *cookie_arg, const void *buffer, size_t size)
processes often close stderr and by writing to file descriptor 2
we might send the log message to a file not intended for logging
(e.g. a pipe or network connection). */
#ifndef HAVE_W32_SYSTEM
if (cookie->want_socket && cookie->fd == -1)
{
/* Not yet open or meanwhile closed due to an error. */
@ -177,6 +186,7 @@ fun_writer (void *cookie_arg, const void *buffer, size_t size)
cookie->is_socket = 1;
}
}
#endif /*HAVE_W32_SYSTEM*/
log_socket = cookie->fd;
if (cookie->fd != -1 && !writen (cookie->fd, buffer, size))
@ -239,6 +249,7 @@ set_file_fd (const char *name, int fd)
fd = fileno (stderr);
}
#ifndef HAVE_W32_SYSTEM
if (name)
{
want_socket = (!strncmp (name, "socket://", 9) && name[9]);
@ -246,6 +257,7 @@ set_file_fd (const char *name, int fd)
name += 9;
}
else
#endif /*HAVE_W32_SYSTEM*/
{
want_socket = 0;
}

View File

@ -25,11 +25,6 @@
#include <errno.h> /* We need errno. */
#include <gpg-error.h> /* We need gpg_error_t. */
/* Add error codes available only in newer versions of libgpg-error. */
#ifndef GPG_ERR_NOT_ENABLED
#define GPG_ERR_NOT_ENABLED 179
#endif
/* Hash function used with libksba. */
#define HASH_FNC ((void (*)(void *, const void*,size_t))gcry_md_write)

View File

@ -17,7 +17,7 @@
* License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
/* Use of this code is preprecated - you better use the sockt wrappers
/* Use of this code is deprecated - you better use the socket wrappers
from libassuan. */
#ifdef _WIN32
@ -51,15 +51,14 @@ read_port_and_nonce (const char *fname, unsigned short *port, char *nonce)
fclose (fp);
if (!nread)
{
#warning remove this file
jnlib_set_errno (EIO);
gpg_err_set_errno (EIO);
return -1;
}
buffer[nread] = 0;
aval = atoi (buffer);
if (aval < 1 || aval > 65535)
{
jnlib_set_errno (EINVAL);
gpg_err_set_errno (EINVAL);
return -1;
}
*port = (unsigned int)aval;
@ -67,7 +66,7 @@ read_port_and_nonce (const char *fname, unsigned short *port, char *nonce)
;
if (*p != '\n' || nread != 17)
{
jnlib_set_errno (EINVAL);
gpg_err_set_errno (EINVAL);
return -1;
}
p++; nread--;
@ -127,7 +126,7 @@ _w32_sock_connect (int sockfd, struct sockaddr *addr, int addrlen)
ret = send (sockfd, nonce, 16, 0);
if (ret >= 0 && ret != 16)
{
jnlib_set_errno (EIO);
gpg_err_set_errno (EIO);
ret = -1;
}
}

View File

@ -1,3 +1,8 @@
2010-03-15 Werner Koch <wk@g10code.com>
* gpgconf-comp.c (my_dgettext):
s/gettext_select_utf8/gettext_use_utf8/.
2010-03-10 Werner Koch <wk@g10code.com>
* Makefile.am (common_libs): Remove libjnlib.a.

View File

@ -1144,7 +1144,7 @@ my_dgettext (const char *domain, const char *msgid)
if (!switched_codeset)
{
switched_codeset = 1;
gettext_select_utf8 (1);
gettext_use_utf8 (1);
}
if (!strcmp (domain, "gnupg"))