diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/ChangeLog | 6 | ||||
-rw-r--r-- | util/dotlock.c | 2 | ||||
-rw-r--r-- | util/http.c | 14 | ||||
-rw-r--r-- | util/iobuf.c | 20 | ||||
-rw-r--r-- | util/simple-gettext.c | 4 | ||||
-rw-r--r-- | util/strgutil.c | 5 | ||||
-rw-r--r-- | util/ttyio.c | 16 | ||||
-rw-r--r-- | util/w32reg.c | 2 |
8 files changed, 38 insertions, 31 deletions
diff --git a/util/ChangeLog b/util/ChangeLog index d676f2f57..0c5cdf9f8 100644 --- a/util/ChangeLog +++ b/util/ChangeLog @@ -1,3 +1,9 @@ +2003-07-30 Werner Koch <[email protected]> + + * dotlock.c [_WIN32]: Don't include sys/time.h + * http.c, iobuf.c, simple-gettext.c: s/__MINGW32__/_WIN32/. + * strgutil.c, ttyio.c, w32reg.c: Ditto. + 2003-06-07 Werner Koch <[email protected]> * iobuf.c (check_special_filename): Replaced is isdigit by digitp diff --git a/util/dotlock.c b/util/dotlock.c index 48b53b364..f4ab37327 100644 --- a/util/dotlock.c +++ b/util/dotlock.c @@ -29,7 +29,9 @@ #include <sys/utsname.h> #endif #include <sys/types.h> +#ifndef _WIN32 #include <sys/time.h> +#endif #include <sys/stat.h> #include <fcntl.h> #include <signal.h> diff --git a/util/http.c b/util/http.c index a272082f1..088c24f59 100644 --- a/util/http.c +++ b/util/http.c @@ -1,5 +1,5 @@ /* http.c - HTTP protocol handler - * Copyright (C) 1999, 2001 Free Software Foundation, Inc. + * Copyright (C) 1999, 2001, 2003 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -26,7 +26,7 @@ #include <ctype.h> #include <errno.h> -#ifdef __MINGW32__ +#ifdef _WIN32 #include <windows.h> #else #include <unistd.h> @@ -53,7 +53,7 @@ #define HTTP_PROXY_ENV_PRINTABLE "$http_proxy" #endif -#ifdef __MINGW32__ +#ifdef _WIN32 #define sock_close(a) closesocket(a) #else #define sock_close(a) close(a) @@ -83,7 +83,7 @@ static int parse_response( HTTP_HD hd ); static int connect_server( const char *server, ushort port ); static int write_server( int sock, const char *data, size_t length ); -#ifdef __MINGW32__ +#ifdef _WIN32 static void deinit_sockets (void) { @@ -113,7 +113,7 @@ init_sockets (void) atexit ( deinit_sockets ); initialized = 1; } -#endif /*__MINGW32__*/ +#endif /*_WIN32*/ int @@ -712,7 +712,7 @@ static int connect_server( const char *server, ushort port ) { int sd; -#ifdef __MINGW32__ +#ifdef _WIN32 struct hostent *hp; struct sockaddr_in ad; unsigned long l; @@ -785,7 +785,7 @@ write_server( int sock, const char *data, size_t length ) nleft = length; while( nleft > 0 ) { -#ifdef __MINGW32__ +#ifdef _WIN32 int nwritten; nwritten = send (sock, data, nleft, 0); diff --git a/util/iobuf.c b/util/iobuf.c index 723255e62..11a513fb1 100644 --- a/util/iobuf.c +++ b/util/iobuf.c @@ -1,5 +1,5 @@ /* iobuf.c - file handling - * Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + * Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -96,7 +96,7 @@ typedef struct { static CLOSE_CACHE close_cache; #endif -#ifdef __MINGW32__ +#ifdef _WIN32 typedef struct { int sock; int keep_open; @@ -105,7 +105,7 @@ typedef struct { int print_only_name; /* flags indicating that fname is not a real file*/ char fname[1]; /* name of the file */ } sock_filter_ctx_t ; -#endif /*__MINGW32__*/ +#endif /*_WIN32*/ /* The first partial length header block must be of size 512 * to make it easier (and efficienter) we use a min. block size of 512 @@ -515,7 +515,7 @@ file_filter(void *opaque, int control, IOBUF chain, byte *buf, size_t *ret_len) return rc; } -#ifdef __MINGW32__ +#ifdef _WIN32 /* Becuase sockets are an special object under Lose32 we have to * use a special filter */ static int @@ -587,7 +587,7 @@ sock_filter (void *opaque, int control, IOBUF chain, byte *buf, size_t *ret_len) } return rc; } -#endif /*__MINGW32__*/ +#endif /*_WIN32*/ /**************** * This is used to implement the block write mode. @@ -1122,7 +1122,7 @@ IOBUF iobuf_sockopen ( int fd, const char *mode ) { IOBUF a; -#ifdef __MINGW32__ +#ifdef _WIN32 sock_filter_ctx_t *scx; size_t len; @@ -1261,7 +1261,7 @@ iobuf_ioctl ( IOBUF a, int cmd, int intval, void *ptrval ) b->keep_open = intval; return 0; } -#ifdef __MINGW32__ +#ifdef _WIN32 else if( !a->chain && a->filter == sock_filter ) { sock_filter_ctx_t *b = a->filter_ov; b->keep_open = intval; @@ -1290,7 +1290,7 @@ iobuf_ioctl ( IOBUF a, int cmd, int intval, void *ptrval ) b->no_cache = intval; return 0; } -#ifdef __MINGW32__ +#ifdef _WIN32 else if( !a->chain && a->filter == sock_filter ) { sock_filter_ctx_t *b = a->filter_ov; b->no_cache = intval; @@ -2141,7 +2141,7 @@ iobuf_read_line( IOBUF a, byte **addr_of_buffer, int iobuf_translate_file_handle ( int fd, int for_write ) { -#ifdef __MINGW32__ +#ifdef _WIN32 { int x; @@ -2164,7 +2164,7 @@ iobuf_translate_file_handle ( int fd, int for_write ) static int translate_file_handle ( int fd, int for_write ) { -#ifdef __MINGW32__ +#ifdef _WIN32 #ifdef FILE_FILTER_USES_STDIO fd = iobuf_translate_file_handle (fd, for_write); #else diff --git a/util/simple-gettext.c b/util/simple-gettext.c index 5d29804f1..151e7b326 100644 --- a/util/simple-gettext.c +++ b/util/simple-gettext.c @@ -27,8 +27,8 @@ #include <config.h> #ifdef USE_SIMPLE_GETTEXT -#if !defined (__MINGW32__) && !defined (__CYGWIN32__) -#error This file can only be used with MingW32 or Cygwin32 +#if !defined (_WIN32) && !defined (__CYGWIN32__) +#error This file can only be used udner Windows or Cygwin32 #endif #include <stdio.h> diff --git a/util/strgutil.c b/util/strgutil.c index 05524d84d..2db4182a5 100644 --- a/util/strgutil.c +++ b/util/strgutil.c @@ -860,7 +860,7 @@ strncasecmp( const char *a, const char *b, size_t n ) #endif -#ifdef __MINGW32__ +#ifdef _WIN32 /* * Like vsprintf but provides a pointer to malloc'd storage, which * must be freed by the caller (m_free). Taken from libiberty as @@ -954,5 +954,4 @@ vasprintf ( char **result, const char *format, va_list args) return 0; } -#endif /*__MINGW32__*/ - +#endif /*_WIN32*/ diff --git a/util/ttyio.c b/util/ttyio.c index 5fc26b422..1612dc32c 100644 --- a/util/ttyio.c +++ b/util/ttyio.c @@ -37,10 +37,10 @@ #define HAVE_TCGETATTR #endif #endif -#ifdef __MINGW32__ /* use the odd Win32 functions */ +#ifdef _WIN32 /* use the odd Win32 functions */ #include <windows.h> #ifdef HAVE_TCGETATTR -#error mingw32 and termios +#error windows and termios #endif #endif #include <errno.h> @@ -51,7 +51,7 @@ #define CONTROL_D ('D' - 'A' + 1) -#ifdef __MINGW32__ /* use the odd Win32 functions */ +#ifdef _WIN32 /* use the odd Win32 functions */ static struct { HANDLE in, out; } con; @@ -124,7 +124,7 @@ init_ttyfp(void) if( initialized ) return; -#if defined(__MINGW32__) +#if defined(_WIN32) { SECURITY_ATTRIBUTES sa; @@ -194,7 +194,7 @@ tty_printf( const char *fmt, ... ) init_ttyfp(); va_start( arg_ptr, fmt ) ; -#ifdef __MINGW32__ +#ifdef _WIN32 { char *buf = NULL; int n; @@ -231,7 +231,7 @@ tty_print_string( byte *p, size_t n ) if( !initialized ) init_ttyfp(); -#ifdef __MINGW32__ +#ifdef _WIN32 /* not so effective, change it if you want */ for( ; n; n--, p++ ) if( iscntrl( *p ) ) { @@ -325,7 +325,7 @@ do_get( const char *prompt, int hidden ) buf = m_alloc(n=50); i = 0; -#ifdef __MINGW32__ /* windoze version */ +#ifdef _WIN32 /* windoze version */ if( hidden ) SetConsoleMode(con.in, HID_INPMODE ); @@ -480,7 +480,7 @@ tty_kill_prompt() last_prompt_len = 0; if( !last_prompt_len ) return; -#ifdef __MINGW32__ +#ifdef _WIN32 tty_printf("\r%*s\r", last_prompt_len, ""); #else { diff --git a/util/w32reg.c b/util/w32reg.c index aa507b2d7..edc77ced9 100644 --- a/util/w32reg.c +++ b/util/w32reg.c @@ -19,7 +19,7 @@ */ #include <config.h> -#if defined (__MINGW32__) || defined (__CYGWIN32__) +#if defined (_WIN32) || defined (__CYGWIN32__) /* This module is only used in this environment */ #include <stdio.h> |