]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Allow the build of ufsdump on Windows
authorserassio <>
Sat, 29 Apr 2006 19:57:39 +0000 (19:57 +0000)
committerserassio <>
Sat, 29 Apr 2006 19:57:39 +0000 (19:57 +0000)
src/ufsdump.cc

index 36ff98a9f318bf02c1770a7210a65dd2cfc39db8..daed49b9223b97e731b937990a6bec581aaff078 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ufsdump.cc,v 1.4 2006/04/29 13:33:03 serassio Exp $
+ * $Id: ufsdump.cc,v 1.5 2006/04/29 13:57:39 serassio Exp $
  *
  * DEBUG: section 0     UFS Store Dump
  * AUTHOR: Robert Collins
@@ -73,13 +73,24 @@ struct DumpStoreMeta : public unary_function<StoreMeta, void>
     }
 };
 
+#if USE_WIN32_SERVICE
+/* When USE_WIN32_SERVICE is defined, the main function is placed in win32.cc */
+extern "C" void WINAPI
+    SquidWinSvcMain(int, char **)
+{}
+
+int
+SquidMain(int argc, char *argv[])
+#else
 int
 main(int argc, char *argv[])
+#endif
 {
     int fd = -1;
     StoreMeta *metadata = NULL;
 
-    try {
+    try
+    {
         if (argc != 2)
             throw std::runtime_error("No filename provided");
 
@@ -119,7 +130,8 @@ main(int argc, char *argv[])
 
 
         return 0;
-    } catch (std::runtime_error error) {
+    } catch (std::runtime_error error)
+    {
         std::cout << "Failed : " << error.what() << std::endl;
 
         if (fd >= 0)