mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
w32: Almost everywhere include winsock2.h before windows.h.
-- This is required by newer mingw toolchain versions which demand that winsock2.h is included before windows.h. Now, due to the use of socket definitions in pth.h we need to include winsock2.h also in pth.h, now pth.h is often included after an include of windows.h and thus the compiler spits out a warning. To avoid that we include winsock2.h at all places the compiler complains about.
This commit is contained in:
parent
a557a74615
commit
40ca0022a7
20 changed files with 436 additions and 380 deletions
21
g10/exec.c
21
g10/exec.c
|
@ -17,7 +17,7 @@
|
|||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
FIXME: We should replace most code in this module by our
|
||||
spawn implementation from common/exechelp.c.
|
||||
*/
|
||||
|
@ -33,7 +33,10 @@
|
|||
#include <sys/wait.h>
|
||||
#endif
|
||||
#ifdef HAVE_DOSISH_SYSTEM
|
||||
#include <windows.h>
|
||||
# ifdef HAVE_WINSOCK2_H
|
||||
# include <winsock2.h>
|
||||
# endif
|
||||
# include <windows.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
@ -50,7 +53,7 @@
|
|||
#include "exec.h"
|
||||
|
||||
#ifdef NO_EXEC
|
||||
int
|
||||
int
|
||||
exec_write(struct exec_info **info,const char *program,
|
||||
const char *args_in,const char *name,int writeonly,int binary)
|
||||
{
|
||||
|
@ -71,7 +74,7 @@ set_exec_path(const char *path) { return G10ERR_GENERAL; }
|
|||
/* This is a nicer system() for windows that waits for programs to
|
||||
return before returning control to the caller. I hate helpful
|
||||
computers. */
|
||||
static int
|
||||
static int
|
||||
w32_system(const char *command)
|
||||
{
|
||||
PROCESS_INFORMATION pi;
|
||||
|
@ -103,7 +106,7 @@ w32_system(const char *command)
|
|||
#endif
|
||||
|
||||
/* Replaces current $PATH */
|
||||
int
|
||||
int
|
||||
set_exec_path(const char *path)
|
||||
{
|
||||
char *p;
|
||||
|
@ -126,7 +129,7 @@ set_exec_path(const char *path)
|
|||
}
|
||||
|
||||
/* Makes a temp directory and filenames */
|
||||
static int
|
||||
static int
|
||||
make_tempdir(struct exec_info *info)
|
||||
{
|
||||
char *tmp=opt.temp_dir,*namein=info->name,*nameout;
|
||||
|
@ -208,7 +211,7 @@ make_tempdir(struct exec_info *info)
|
|||
|
||||
/* Expands %i and %o in the args to the full temp files within the
|
||||
temp directory. */
|
||||
static int
|
||||
static int
|
||||
expand_args(struct exec_info *info,const char *args_in)
|
||||
{
|
||||
const char *ch = args_in;
|
||||
|
@ -297,7 +300,7 @@ expand_args(struct exec_info *info,const char *args_in)
|
|||
If there are args, but no tempfiles, then it's a fork/exec/pipe via
|
||||
shell -c. If there are tempfiles, then it's a system. */
|
||||
|
||||
int
|
||||
int
|
||||
exec_write(struct exec_info **info,const char *program,
|
||||
const char *args_in,const char *name,int writeonly,int binary)
|
||||
{
|
||||
|
@ -599,7 +602,7 @@ exec_finish(struct exec_info *info)
|
|||
log_info(_("WARNING: unable to remove tempfile (%s) `%s': %s\n"),
|
||||
"in",info->tempfile_in,strerror(errno));
|
||||
}
|
||||
|
||||
|
||||
if(info->tempfile_out)
|
||||
{
|
||||
if(unlink(info->tempfile_out)==-1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue