Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign

logic error on the SupportsCurrentPlatform() related code

<< < (2/2)

ollydbg:
Hi, Huki, thanks, before commit the fix to trunk, I just want to ask a simple question:

--- Code: ---@@ -2009,7 +2008,11 @@ bool NativeParser::AddCompilerPredefinedMacrosGCC(const wxString& compilerId, cb
 
     wxString masterPath = compiler->GetMasterPath();
     Manager::Get()->GetMacrosManager()->ReplaceMacros(masterPath);
+#ifdef __WXMSW__
     const wxString cpp_compiler = masterPath + _T("\\bin\\") + compiler->GetPrograms().CPP;
+#else
+    const wxString cpp_compiler = masterPath + _T("/bin/") + compiler->GetPrograms().CPP;
+#endif
     if ( !wxFileName::FileExists(cpp_compiler) )
         return false;
 
--- End code ---
What was the problem if we don't have the above patch applied under Linux? Will wxFileName::FileExists() function call fail? If this does fail, then I believe this is a very long time bug. I don't have a Linux system at hand, so I can't verify myself. :)

Huki:

--- Quote from: ollydbg on April 08, 2015, 03:38:50 pm ---What was the problem if we don't have the above patch applied under Linux? Will wxFileName::FileExists() function call fail? If this does fail, then I believe this is a very long time bug. I don't have a Linux system at hand, so I can't verify myself. :)

--- End quote ---
Yes, the wxFileName::FileExists() call fails. I just tried skipping this check and keep the backward slash to see what happens: then the wxExecute does not report a failure, but no defines are collected (the defines list is empty). So it seems the wxExecute actually fails but it doesn't get reported.
By using forward slash for "/bin/" the defines are collected properly.

ollydbg:

--- Quote from: Huki on April 08, 2015, 05:10:15 pm ---
--- Quote from: ollydbg on April 08, 2015, 03:38:50 pm ---What was the problem if we don't have the above patch applied under Linux? Will wxFileName::FileExists() function call fail? If this does fail, then I believe this is a very long time bug. I don't have a Linux system at hand, so I can't verify myself. :)

--- End quote ---
Yes, the wxFileName::FileExists() call fails. I just tried skipping this check and keep the backward slash to see what happens: then the wxExecute does not report a failure, but no defines are collected (the defines list is empty). So it seems the wxExecute actually fails but it doesn't get reported.
By using forward slash for "/bin/" the defines are collected properly.


--- End quote ---
Thanks, and it is in trunk now.

Navigation

[0] Message Index

[*] Previous page

Go to full version