From c9627cdbc65b25da943f24e6a953da899f08eefc Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Mon, 1 Apr 2013 12:40:48 +1100 Subject: - (dtucker) [openbsd-compat/bsd-cygwin_util.{c,h}] Don't include windows.h to avoid conflicting definitions of __int64, adding the required bits. Patch from Corinna Vinschen. --- ChangeLog | 5 +++++ openbsd-compat/bsd-cygwin_util.c | 11 +++-------- openbsd-compat/bsd-cygwin_util.h | 17 +++++++---------- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2b99b570..9668465b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +20130401 + - (dtucker) [openbsd-compat/bsd-cygwin_util.{c,h}] Don't include windows.h + to avoid conflicting definitions of __int64, adding the required bits. + Patch from Corinna Vinschen. + 20120323 - (tim) [Makefile.in] remove some duplication introduced in 20130220 commit. diff --git a/openbsd-compat/bsd-cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c index 6befc016..d3d2d913 100644 --- a/openbsd-compat/bsd-cygwin_util.c +++ b/openbsd-compat/bsd-cygwin_util.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, 2011 Corinna Vinschen + * Copyright (c) 2000, 2001, 2011, 2013 Corinna Vinschen * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,20 +27,15 @@ * binary mode on Windows systems. */ +#define NO_BINARY_OPEN /* Avoid redefining open to binary_open for this file */ #include "includes.h" #ifdef HAVE_CYGWIN -#if defined(open) && open == binary_open -# undef open -#endif - #include - #include -#include +#include #include -#include #include "xmalloc.h" diff --git a/openbsd-compat/bsd-cygwin_util.h b/openbsd-compat/bsd-cygwin_util.h index b4bcd04b..372e4195 100644 --- a/openbsd-compat/bsd-cygwin_util.h +++ b/openbsd-compat/bsd-cygwin_util.h @@ -1,7 +1,7 @@ -/* $Id: bsd-cygwin_util.h,v 1.15 2012/08/28 09:57:19 dtucker Exp $ */ +/* $Id: bsd-cygwin_util.h,v 1.16 2013/04/01 01:40:49 dtucker Exp $ */ /* - * Copyright (c) 2000, 2001, 2011 Corinna Vinschen + * Copyright (c) 2000, 2001, 2011, 2013 Corinna Vinschen * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -36,24 +36,21 @@ #undef ERROR -#define WIN32_LEAN_AND_MEAN +/* Avoid including windows headers. */ +typedef void *HANDLE; +#define INVALID_HANDLE_VALUE ((HANDLE) -1) -#include #include #include -/* Make sure _WIN32 isn't defined later in the code, otherwise headers from - other packages might get the wrong idea about the target system. */ -#ifdef _WIN32 -#undef _WIN32 -#endif - int binary_open(const char *, int , ...); int check_ntsec(const char *); char **fetch_windows_environment(void); void free_windows_environment(char **); +#ifndef NO_BINARY_OPEN #define open binary_open +#endif #endif /* HAVE_CYGWIN */ -- cgit v1.2.3