From e2e5b01d771339a596a418ec306fe00ab504e593 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Wed, 26 Dec 2018 18:10:12 +0100 Subject: cli_main: remove real_main from stack traces for non-Windows Restore the "main" name since that is used everywhere else except for Windows. On Windows, "main" is renamed via a macro to avoid a conflict with "wmain" and to allow it to be called in cli_main.c. For those wondering, GUI applications (such as Qt) have a different entry point, namely WinMain. In Qt5, src/winmain/qtmain_win.cpp defines WinMain, but seems to convert its arguments from Unicode to CP_ACP (ASCII). It might not support UTF-8, but I did not verify this. Change-Id: I93fa59324eb2ef95a305b08fc5ba34d49cc73bf0 Reviewed-on: https://code.wireshark.org/review/31208 Petri-Dish: Peter Wu Reviewed-by: Anders Broman --- cli_main.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'cli_main.h') diff --git a/cli_main.h b/cli_main.h index fc947b4ce3..e515485529 100644 --- a/cli_main.h +++ b/cli_main.h @@ -1,9 +1,8 @@ /* * Declaration of the real main routine, for all CLI programs where the * main routine should get UTF-8 arguments on Windows. In those programs, - * in the file that defines the main routine, include this header and define - * the main routine as real_main() rather than main(), and build those - * programs with cli_main.c and link with the object file. + * in the file that defines the main routine, include this header and link + * those programs with cli_main.c. * * This is used in software licensed under the GPLv2, and its license MUST * be compatible with that license. @@ -16,4 +15,7 @@ * SPDX-License-Identifier: MIT */ -extern int real_main(int argc, char *argv[]); +#ifdef _WIN32 +int real_main(int argc, char *argv[]); +#define main real_main +#endif -- cgit v1.2.3