From: Amos Jeffries Date: Mon, 8 Oct 2012 08:40:01 +0000 (-0600) Subject: Windows: simplify abstraction layer header files X-Git-Tag: SQUID_3_4_0_1~592 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c164de6e7034c409a1aab82d4af80cc9996387b2;p=thirdparty%2Fsquid.git Windows: simplify abstraction layer header files Merge compat/os/windows.h, compat/os/mswin.h, and include/squid_windows.h into a single compat/os/mswindows.h pulled in via the compat.h. Also, rename compat/mswin.cc to match the new header .h name. --- diff --git a/compat/Makefile.am b/compat/Makefile.am index a3e3ff257a..bbd27cb3bc 100644 --- a/compat/Makefile.am +++ b/compat/Makefile.am @@ -62,8 +62,8 @@ libcompat_squid_a_SOURCES = \ os/hpux.h \ os/linux.h \ os/macosx.h \ - os/mswin.h \ - mswin.cc \ + os/mswindows.h \ + mswindows.cc \ os/netbsd.h \ os/next.h \ os/openbsd.h \ @@ -72,8 +72,7 @@ libcompat_squid_a_SOURCES = \ os/qnx.h \ os/sgi.h \ os/solaris.h \ - os/sunos.h \ - os/windows.h + os/sunos.h libcompat_squid_a_LIBADD= $(LIBOBJS) diff --git a/compat/mswin.cc b/compat/mswindows.cc similarity index 99% rename from compat/mswin.cc rename to compat/mswindows.cc index a731792e04..bb057492dd 100644 --- a/compat/mswin.cc +++ b/compat/mswindows.cc @@ -46,7 +46,6 @@ #include #include #include -#include "squid_windows.h" #include #include #if HAVE_WIN32_PSAPI diff --git a/compat/os/mswin.h b/compat/os/mswindows.h similarity index 97% rename from compat/os/mswin.h rename to compat/os/mswindows.h index 4cc1b0d0aa..6edc67b6b5 100644 --- a/compat/os/mswin.h +++ b/compat/os/mswindows.h @@ -29,8 +29,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * */ -#ifndef SQUID_OS_MSWIN_H -#define SQUID_OS_MSWIN_H +#ifndef SQUID_OS_MSWINDOWS_H +#define SQUID_OS_MSWINDOWS_H #if _SQUID_WINDOWS_ @@ -771,5 +771,21 @@ SQUIDCEXTERN size_t getpagesize(void); #define PRINTF_FORMAT_ARG3 #endif +/* XXX: the logic around this is a bit warped: + * we #define ACL unconditionally at the top of this file, + * then #undef ACL unconditionally hafway down, + * then here re-define ACL to the same value as at the top, + * then include windows.h and #undef ACL again. + */ +#ifndef ACL +#define ACL WindowsACL +#define _MSWIN_ACL_WAS_NOT_DEFINED 1 +#endif +#include +#if _MSWIN_ACL_WAS_NOT_DEFINED +#undef ACL +#undef _MSWIN_ACL_WAS_NOT_DEFINED +#endif + #endif /* _SQUID_WINDOWS_ */ -#endif /* SQUID_OS_MSWIN_H */ +#endif /* SQUID_OS_MSWINDOWS_H */ diff --git a/compat/os/windows.h b/compat/os/windows.h deleted file mode 100644 index 6215255345..0000000000 --- a/compat/os/windows.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * AUTHOR: Guido Serassio - * - * SQUID Web Proxy Cache http://www.squid-cache.org/ - * ---------------------------------------------------------- - * - * Squid is the result of efforts by numerous individuals from - * the Internet community; see the CONTRIBUTORS file for full - * details. Many organizations have provided support for Squid's - * development; see the SPONSORS file for full details. Squid is - * Copyrighted (C) 2001 by the Regents of the University of - * California; see the COPYRIGHT file for full details. Squid - * incorporates software developed and/or copyrighted by other - * sources; see the CREDITS file for full details. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. - * - */ -#ifndef SQUID_OS_WINDOWS_H -#define SQUID_OS_WINDOWS_H - -#if _SQUID_WINDOWS_ - -#ifndef ACL -#define ACL WindowsACL -#define _MSWIN_ACL_WAS_NOT_DEFINED 1 -#endif -#include -#if _MSWIN_ACL_WAS_NOT_DEFINED -#undef ACL -#undef _MSWIN_ACL_WAS_NOT_DEFINED -#endif - -#endif /* _SQUID_WINDOWS_ */ -#endif /* SQUID_OS_WINDOWS_H */ diff --git a/include/squid_windows.h b/include/squid_windows.h deleted file mode 100644 index 558afcd4ae..0000000000 --- a/include/squid_windows.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * AUTHOR: Guido Serassio - * - * SQUID Web Proxy Cache http://www.squid-cache.org/ - * ---------------------------------------------------------- - * - * Squid is the result of efforts by numerous individuals from - * the Internet community; see the CONTRIBUTORS file for full - * details. Many organizations have provided support for Squid's - * development; see the SPONSORS file for full details. Squid is - * Copyrighted (C) 2001 by the Regents of the University of - * California; see the COPYRIGHT file for full details. Squid - * incorporates software developed and/or copyrighted by other - * sources; see the CREDITS file for full details. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. - * - */ -#ifndef _INC_SQUID_WINDOWS_H -#define _INC_SQUID_WINDOWS_H - -#if _SQUID_WINDOWS_ - -#ifndef ACL -#define ACL WindowsACL -#define _MSWIN_ACL_WAS_NOT_DEFINED 1 -#endif -#include -#if _MSWIN_ACL_WAS_NOT_DEFINED -#undef ACL -#undef _MSWIN_ACL_WAS_NOT_DEFINED -#endif - -#endif /* _SQUID_WINDOWS_ */ -#endif /* _INC_SQUID_WINDOWS_H */ diff --git a/src/DiskIO/AIO/aio_win32.h b/src/DiskIO/AIO/aio_win32.h index fb05246277..e829520bc2 100644 --- a/src/DiskIO/AIO/aio_win32.h +++ b/src/DiskIO/AIO/aio_win32.h @@ -34,10 +34,6 @@ #if USE_DISKIO_AIO -#if _SQUID_CYGWIN_ -#include "squid_windows.h" -#endif - #ifndef off64_t typedef int64_t off64_t; #endif diff --git a/src/DiskIO/DiskThreads/aiops_win32.cc b/src/DiskIO/DiskThreads/aiops_win32.cc index 9523acbef2..1c322a5940 100644 --- a/src/DiskIO/DiskThreads/aiops_win32.cc +++ b/src/DiskIO/DiskThreads/aiops_win32.cc @@ -33,7 +33,6 @@ */ #include "squid.h" -#include "squid_windows.h" #include "DiskIO/DiskThreads/CommIO.h" #include "DiskThreads.h" #include "SquidConfig.h" diff --git a/src/WinSvc.cc b/src/WinSvc.cc index cac66d5d18..8f023fa71b 100644 --- a/src/WinSvc.cc +++ b/src/WinSvc.cc @@ -33,7 +33,6 @@ #include "squid.h" #include "protos.h" -#include "squid_windows.h" #if _SQUID_WINDOWS_ #ifndef _MSWSOCK_ diff --git a/src/dns_internal.cc b/src/dns_internal.cc index 7af69c1455..fbb8704426 100644 --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -72,7 +72,6 @@ */ #if !USE_DNSHELPER #if _SQUID_WINDOWS_ -#include "squid_windows.h" #define REG_TCPIP_PARA_INTERFACES "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces" #define REG_TCPIP_PARA "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters" #define REG_VXD_MSTCP "SYSTEM\\CurrentControlSet\\Services\\VxD\\MSTCP" diff --git a/src/eui/Eui48.cc b/src/eui/Eui48.cc index 57694d8192..a96561a749 100644 --- a/src/eui/Eui48.cc +++ b/src/eui/Eui48.cc @@ -44,9 +44,6 @@ #if HAVE_ERRNO_H #include #endif -#if _SQUID_CYGWIN_ -#include -#endif /* START Legacy includes pattern */ /* TODO: clean this up so we dont have per-OS requirements. diff --git a/src/main.cc b/src/main.cc index 5468467d8f..544fe2838c 100644 --- a/src/main.cc +++ b/src/main.cc @@ -153,7 +153,6 @@ #endif #if USE_WIN32_SERVICE -#include "squid_windows.h" #include static int opt_install_service = FALSE; @@ -162,7 +161,6 @@ static int opt_signal_service = FALSE; static int opt_command_line = FALSE; void WIN32_svcstatusupdate(DWORD, DWORD); void WINAPI WIN32_svcHandler(DWORD); - #endif #if !defined(SQUID_BUILD_INFO) diff --git a/src/win32.cc b/src/win32.cc index 1fe62cf779..451afb9eb0 100644 --- a/src/win32.cc +++ b/src/win32.cc @@ -32,7 +32,6 @@ */ #include "squid.h" -#include "squid_windows.h" #include "win32.h" #if _SQUID_WINDOWS_