Ver Fonte

Rearrange definition of main for exe test

bel há 10 anos atrás
pai
commit
8165305549
5 ficheiros alterados com 14 adições e 7 exclusões
  1. 1 1
      src/civetweb.c
  2. 7 1
      src/main.c
  3. 1 1
      test/main.c
  4. 4 0
      test/private_exe.c
  5. 1 4
      test/private_exe.h

+ 1 - 1
src/civetweb.c

@@ -9982,7 +9982,7 @@ get_rel_url_at_current_server(const char *uri, const struct mg_connection *conn)
 	unsigned long port = 0;
 	int i;
 	char *hostend = NULL;
-    char *portbegin, *portend;
+	char *portbegin, *portend;
 
 	/* DNS is case insensitive, so use case insensitive string compare here */
 	domain = conn->ctx->config[AUTHENTICATION_DOMAIN];

+ 7 - 1
src/main.c

@@ -2233,7 +2233,13 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR cmdline, int show)
 }
 
 
-int main(int argc, char *argv[]) { return WinMain(0, 0, 0, 0); }
+int main(int argc, char *argv[])
+{
+	(void)argc;
+	(void)argv;
+
+	return WinMain(0, 0, 0, 0);
+}
 
 
 #elif defined(USE_COCOA)

+ 1 - 1
test/main.c

@@ -36,7 +36,7 @@
  * http://check.sourceforge.net/doc/check_html/index.html
  */
 
-int main(const int argc, const char *const *const argv)
+int main(const int argc, char *argv[])
 {
 	// Determine what tests to run
 	const char *suite = NULL;

+ 4 - 0
test/private_exe.c

@@ -35,6 +35,10 @@
  * practice this does not work. */
 extern char *realpath(const char *path, char *resolved_path);
 
+/* main is already used in the test suite,
+ * so this define will rename main in main.c */
+#define main exe_main
+
 #include "../src/main.c"
 
 #include <stdlib.h>

+ 1 - 4
test/private_exe.h

@@ -25,10 +25,7 @@
 
 Suite *make_private_exe_suite(void);
 
-
-/* main is already used in the test suite,
- * so this define will rename main in main.c */
-#define main exe_main
+/* This is a redefine for "main" in main.c */
 int exe_main(int argc, char *argv[]);