News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Codeblocks portable

Started by xors3d, October 06, 2010, 06:40:40 PM

Previous topic - Next topic

imianz


oBFusCATed


Compiler relative path: $(CODEBLOCKS)\MinGW


This is the problem, the CC doesn't do macro replacements, it seems...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

imianz

ok, do you believe that you can fix it?

ollydbg

Quote from: oBFusCATed on October 05, 2011, 02:18:56 PM

Compiler relative path: $(CODEBLOCKS)\MinGW

This is not the log message. :D :D

Quote
This is the problem, the CC doesn't do macro replacements, it seems...
True.

@imianz
You'd better post your log message in the code/quote tab.
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.

ollydbg

Index: E:/code/cb/cb_trunk/src/plugins/codecompletion/nativeparser.cpp
===================================================================
--- E:/code/cb/cb_trunk/src/plugins/codecompletion/nativeparser.cpp (revision 7475)
+++ E:/code/cb/cb_trunk/src/plugins/codecompletion/nativeparser.cpp (working copy)
@@ -663,7 +663,9 @@
             if (compiler->GetID().Contains(_T("gcc")))
             {
                 wxFileName fn(wxEmptyString, compiler->GetPrograms().CPP);
-                fn.SetPath(compiler->GetMasterPath());
+                wxString masterPath = compiler->GetMasterPath();
+                Manager::Get()->GetMacrosManager()->ReplaceMacros(masterPath);
+                fn.SetPath(masterPath);
                 fn.AppendDir(_T("bin"));
                 const wxArrayString& gccDirs = GetGCCCompilerDirs(fn.GetFullPath());
                 TRACE(_T("Adding %d cached gcc dirs to parser..."), gccDirs.GetCount());
@@ -792,7 +794,9 @@
         if (CompilerID.Contains(_T("gcc")))
         {
             wxFileName fn(wxEmptyString, ((Compilers[idxCompiler])->GetPrograms()).CPP);
-            fn.SetPath((Compilers[idxCompiler])->GetMasterPath());
+            wxString masterPath = (Compilers[idxCompiler])->GetMasterPath();
+            Manager::Get()->GetMacrosManager()->ReplaceMacros(masterPath);
+            fn.SetPath(masterPath);
             fn.AppendDir(_T("bin"));
             const wxArrayString& gccDirs = GetGCCCompilerDirs(fn.GetFullPath());
             TRACE(_T("Adding %d cached gcc dirs to parser..."), gccDirs.GetCount());
@@ -837,7 +841,9 @@
             return false;

         wxFileName fn(wxEmptyString, compiler->GetPrograms().CPP);
-        fn.SetPath(compiler->GetMasterPath());
+        wxString masterPath = compiler->GetMasterPath();
+        Manager::Get()->GetMacrosManager()->ReplaceMacros(masterPath);
+        fn.SetPath(masterPath);
         fn.AppendDir(_T("bin"));

         static std::map<wxString, wxString> defsMap;
@@ -917,7 +923,10 @@
             Compiler* compiler = CompilerFactory::GetCompiler(compilerId);
             if(!compiler)
                 return false;
-            wxString cmd = compiler->GetMasterPath() + _T("\\bin\\") + compiler->GetPrograms().C;
+
+            wxString masterPath = compiler->GetMasterPath();
+            Manager::Get()->GetMacrosManager()->ReplaceMacros(masterPath);
+            wxString cmd = masterPath + _T("\\bin\\") + compiler->GetPrograms().C;
             Manager::Get()->GetMacrosManager()->ReplaceMacros(cmd);

             // wxExecute can be a long action and C::B might have been shutdown in the meantime...

The patch should fix the problem, but do we need to refactor the function body GetMasterPath()?
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.

imianz

Quote from: ollydbg on October 05, 2011, 03:59:29 PM
The patch should fix the problem, ....

Yeah! It does.
I can confirm you.
I was too curious to wait for the patch was placed in a nightly build, so I downloaded the source code (7478) and manually applied the patch and build...
Not tested hard, but at first glance seems to work ok.

Post scriptum
The strange thing is the CB splash screen, it show me the revision zero... mah!

oBFusCATed

Quote from: imianz on October 05, 2011, 11:14:24 PM
The strange thing is the CB splash screen, it show me the revision zero... mah!
It is normal, you have to run some script to generate the info...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Jenna

Quote from: oBFusCATed on October 05, 2011, 11:16:40 PM
Quote from: imianz on October 05, 2011, 11:14:24 PM
The strange thing is the CB splash screen, it show me the revision zero... mah!
It is normal, you have to run some script to generate the info...
On windows you need commandline svn in systempath in addition to a gui-client like TortoiseSVN.

imianz