--------------------- PatchSet 11556 Date: 2007/08/12 10:09:46 Author: serassio Branch: HEAD Tag: (none) Log: Windows port: Fix compiler warnings when building Squid as application (not Windows service mode) Members: src/win32.c:1.17->1.18 Index: squid/src/win32.c =================================================================== RCS file: /cvsroot/squid/squid/src/win32.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- squid/src/win32.c 29 Oct 2006 08:21:50 -0000 1.17 +++ squid/src/win32.c 12 Aug 2007 10:09:46 -0000 1.18 @@ -1,6 +1,6 @@ /* - * $Id: win32.c,v 1.17 2006/10/29 08:21:50 serassio Exp $ + * $Id: win32.c,v 1.18 2007/08/12 10:09:46 serassio Exp $ * * Windows support * AUTHOR: Guido Serassio @@ -54,9 +54,11 @@ static unsigned int GetOSVersion(); void WIN32_svcstatusupdate(DWORD, DWORD); void WINAPI WIN32_svcHandler(DWORD); +#if USE_WIN32_SERVICE static int WIN32_StoreKey(const char *, DWORD, unsigned char *, int); static int WIN32_create_key(void); static void WIN32_build_argv(char *); +#endif /* USE_WIN32_SERVICE */ void WINAPI SquidWinSvcMain(DWORD, char **); #if defined(_SQUID_MSWIN_) @@ -67,11 +69,14 @@ static LPTOP_LEVEL_EXCEPTION_FILTER Win32_Old_ExceptionHandler = NULL; #endif /* _SQUID_MSWIN_ */ +#if USE_WIN32_SERVICE static SERVICE_STATUS svcStatus; static SERVICE_STATUS_HANDLE svcHandle; + static int WIN32_argc; static char **WIN32_argv; static char *WIN32_module_name; +#endif /* USE_WIN32_SERVICE */ static int Squid_Aborting = 0; #define VENDOR "GNU" @@ -86,6 +91,7 @@ #else #define CHANGESERVICECONFIG2 "ChangeServiceConfig2A" #endif +#if USE_WIN32_SERVICE static SC_ACTION Squid_SCAction[] = { {SC_ACTION_RESTART, 60000}}; @@ -93,6 +99,7 @@ {SOFTWARENAME " " VERSION " " PACKAGE_NAME}; static SERVICE_FAILURE_ACTIONS Squid_ServiceFailureActions = {INFINITE, NULL, NULL, 1, Squid_SCAction}; + static char REGKEY[256] = "SOFTWARE\\" VENDOR "\\" SOFTWARENAME "\\" WIN32_VERSION "\\"; static char *keys[] = { @@ -103,11 +110,13 @@ NULL, /* key[4] */ NULL /* key[5] */ }; +#endif /* USE_WIN32_SERVICE */ /* ====================================================================== */ /* LOCAL FUNCTIONS */ /* ====================================================================== */ +#if USE_WIN32_SERVICE static int WIN32_create_key(void) { @@ -221,6 +230,7 @@ } return retval; } +#endif /* USE_WIN32_SERVICE */ static unsigned int GetOSVersion() @@ -293,6 +303,7 @@ return _WIN_OS_UNKNOWN; } +#if USE_WIN32_SERVICE /* Build argv, argc from string passed from Windows. */ static void WIN32_build_argv(char *cmd) @@ -330,6 +341,8 @@ WIN32_argv[WIN32_argc] = NULL; } +#endif + /* ====================================================================== */ /* PUBLIC FUNCTIONS */ /* ====================================================================== */