News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

r13615 fails to compile with wxWidgets-3.3.0.0

Started by everSome, February 18, 2025, 05:42:12 AM

Previous topic - Next topic

everSome

Seems wxWidgets-3.3.0.0 has gotten stricter in checking usage of macros such as _() and friends. In particular, sdk/pluginmanager.cpp line 764 doesn't work.:
static wxString RemoveCRAndTranslate(const wxString& value)
{
    wxString Result(value);
    Result.Replace("\r\n", "\n");
    return _(Result);
}


See
https://wxwidgets.org/help/msgid-literals/
for details.

ollydbg

Thanks, so it looks like _() is not allowed by passing a wxString as argument.

How do we fix that issue in the function: RemoveCRAndTranslate()? Just remove the _() macro?

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

everSome

Maybe use something like:
const wxString& wxGetTranslation    (    const wxString &     string,
      const wxString &     domain = wxEmptyString,
      const wxString &     context = wxEmptyString
   )    

as it takes a wxString as input.

Miguel Gimenez

Yes, wxGetTranslation() is the recommended method; see p.e this PR.

Miguel Gimenez

I am fixing those issues, will commit in a while...

Miguel Gimenez


stahta01

#6

--- a/src/plugins/contrib/clangd_client/src/codecompletion/parser/parser.cpp
+++ b/src/plugins/contrib/clangd_client/src/codecompletion/parser/parser.cpp
@@ -1567,7 +1567,7 @@ void Parser::ShowGlobalChangeAnnoyingMsg()
                        "on the project title in the Workspace tree and selecting\n"
                        "'Reparse current project'.");

-        AnnoyingDialog dlg(_("Global settings warning"), _(warningMsg), wxART_WARNING,
+        AnnoyingDialog dlg(_("Global settings warning"), warningMsg, wxART_WARNING,
                            AnnoyingDialog::OK);
         dlg.ShowModal();
     }//endif size


I had to apply this patch to build master from https://github.com/arnholm/codeblocks_sfmirror.git   13621

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Miguel Gimenez


stahta01

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Wkerry

Via github it was relatively easy to find that the following commit reverted it:
https://github.com/arnholm/codeblocks_sfmirror/commit/2cc176ba23528185ca18d5377510b64e7a81b38f#diff-4007afe15336751ba46fee72ba5ed7002efc465819b8384b5b0fb76edfd41741R394-R1570

The comment/svn reference is:
- Clangd_client Remove dead/unused code, no additions or code changes
git-svn-id: https://svn.code.sf.net/p/codeblocks/code/trunk@13636 2a5c6006-c6dd-42ca-98ab-0921f2732cef

I do not use SVN and find the github repo allot easier to use to find things.

Miguel Gimenez