From 724043be0b9ed68382c49c54b4750ddeaebe81c4 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sun, 5 Jul 2015 18:15:41 +0200 Subject: Windows: Display source location of errors in order to help diagnose issues reported by users --- src/Common/Cmdline.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/Common/Cmdline.c') diff --git a/src/Common/Cmdline.c b/src/Common/Cmdline.c index 6e325fe3..929b777d 100644 --- a/src/Common/Cmdline.c +++ b/src/Common/Cmdline.c @@ -22,6 +22,10 @@ #include "Language.h" #include +#ifndef SRC_POS +#define SRC_POS (__FUNCTION__ ":" TC_TO_STRING(__LINE__)) +#endif + /* Except in response to the WM_INITDIALOG message, the dialog box procedure should return nonzero if it processes the message, and zero if it does not. - see DialogProc */ @@ -92,7 +96,7 @@ int Win32CommandLine (char *lpszCommandLine, char ***lpszArgs) LPWSTR *arguments = CommandLineToArgvW (GetCommandLineW(), &argumentCount); if (!arguments) { - handleWin32Error (NULL); + handleWin32Error (NULL, SRC_POS); return 0; } @@ -120,7 +124,7 @@ int Win32CommandLine (char *lpszCommandLine, char ***lpszArgs) int len = WideCharToMultiByte (CP_ACP, 0, arguments[i + 1], -1, arg, (int) argLen + 1, NULL, NULL); if (len == 0) { - handleWin32Error (NULL); + handleWin32Error (NULL, SRC_POS); AbortProcessSilent(); } } -- cgit v1.2.3