User forums > General (but related to Code::Blocks)
[Work In Progress] Patches to Compile C::B against wxWidgets 2.9.0
stahta01:
Patch needed for building using CygWin. Tim S
--- Code: ---Index: codeblocks-trunk/src/include/wxscintilla/include/wx/wxscintilla.h
===================================================================
--- codeblocks-trunk/src/include/wxscintilla/include/wx/wxscintilla.h (revision 5593)
+++ codeblocks-trunk/src/include/wxscintilla/include/wx/wxscintilla.h (working copy)
@@ -2067,7 +2067,9 @@
//----------------------------------------------------------------------
+#if !wxCHECK_VERSION(2, 9, 0)
typedef long wxIntPtr; // FIXME: back-port from wx29 (svn) to wx289
+#endif
class WXDLLIMPEXP_SCI wxScintilla : public wxControl {
public:
--- End code ---
stahta01:
Patch needed for lib_finder
--- Code: ---Index: src/plugins/contrib/lib_finder/lib_finder.cpp
===================================================================
--- src/plugins/contrib/lib_finder/lib_finder.cpp (revision 5585)
+++ src/plugins/contrib/lib_finder/lib_finder.cpp (working copy)
@@ -515,7 +515,11 @@
wxURL UrlData(Url);
if ( !UrlData.IsOk() )
{
+ #if wxCHECK_VERSION(2, 9, 0)
+ LogManager::Get()->LogWarning(F(_T("lib_finder: Invalid url '%s'"),Url.wx_str()));
+ #else
LogManager::Get()->LogWarning(F(_T("lib_finder: Invalid url '%s'"),Url.c_str()));
+ #endif
continue;
}
UrlData.SetProxy( ConfigManager::GetProxy() );
@@ -523,7 +527,11 @@
wxInputStream* is = UrlData.GetInputStream();
if ( !is || !is->IsOk() )
{
+ #if wxCHECK_VERSION(2, 9, 0)
+ LogManager::Get()->LogWarning(F(_T("lib_finder: Couldn't open stream for '%s'"),Url.wx_str()));
+ #else
LogManager::Get()->LogWarning(F(_T("lib_finder: Couldn't open stream for '%s'"),Url.c_str()));
+ #endif
delete is;
continue;
}
@@ -531,7 +539,11 @@
wxFileOutputStream Output(FileName);
if ( !Output.IsOk() )
{
+ #if wxCHECK_VERSION(2, 9, 0)
+ LogManager::Get()->LogWarning(F(_T("lib_finder: Couldn't write to file '%s'"),FileName.wx_str()));
+ #else
LogManager::Get()->LogWarning(F(_T("lib_finder: Couldn't write to file '%s'"),FileName.c_str()));
+ #endif
delete is;
return false;
}
@@ -542,7 +554,11 @@
return ret;
}
+ #if wxCHECK_VERSION(2, 9, 0)
+ LogManager::Get()->LogWarning(F(_T("lib_finder: Couldn't find suitable download url for '%s'"),ShortCode.wx_str()));
+ #else
LogManager::Get()->LogWarning(F(_T("lib_finder: Couldn't find suitable download url for '%s'"),ShortCode.c_str()));
+ #endif
return false;
}
Index: src/plugins/contrib/lib_finder/defsdownloaddlg.cpp
===================================================================
--- src/plugins/contrib/lib_finder/defsdownloaddlg.cpp (revision 5585)
+++ src/plugins/contrib/lib_finder/defsdownloaddlg.cpp (working copy)
@@ -112,7 +112,11 @@
wxURL UrlData(Url);
if ( !UrlData.IsOk() )
{
+ #if wxCHECK_VERSION(2, 9, 0)
+ LogManager::Get()->LogWarning(F(_T("lib_finder: Invalid url '%s'"),Url.wx_str()));
+ #else
LogManager::Get()->LogWarning(F(_T("lib_finder: Invalid url '%s'"),Url.c_str()));
+ #endif
continue;
}
UrlData.SetProxy( ConfigManager::GetProxy() );
@@ -120,7 +124,11 @@
std::auto_ptr< wxInputStream > is ( UrlData.GetInputStream() );
if ( !is.get() || !is->IsOk() )
{
+ #if wxCHECK_VERSION(2, 9, 0)
+ LogManager::Get()->LogWarning(F(_T("lib_finder: Couldn't open stream for '%s'"),Url.wx_str()));
+ #else
LogManager::Get()->LogWarning(F(_T("lib_finder: Couldn't open stream for '%s'"),Url.c_str()));
+ #endif
continue;
}
@@ -137,7 +145,11 @@
TiXmlDocument doc;
if ( !doc.Parse( (const char*) memory.GetOutputStreamBuffer()->GetBufferStart() ) )
{
+ #if wxCHECK_VERSION(2, 9, 0)
+ LogManager::Get()->LogWarning(F(_T("lib_finder: Invalid XML data in '%s'"),Url.wx_str()));
+ #else
LogManager::Get()->LogWarning(F(_T("lib_finder: Invalid XML data in '%s'"),Url.c_str()));
+ #endif
continue;
}
--- End code ---
stahta01:
Patch needed for envvars
--- Code: ---Index: src/plugins/contrib/envvars/envvars_common.cpp
===================================================================
--- src/plugins/contrib/envvars/envvars_common.cpp (revision 5598)
+++ src/plugins/contrib/envvars/envvars_common.cpp (working copy)
@@ -165,7 +165,11 @@
if (!active_set_cfg.IsEmpty())
active_set = active_set_cfg;
+ #if wxCHECK_VERSION(2, 9, 0)
+ EV_DBGLOG(_T("EnvVars: Obtained '%s' as active envvar set from config."), active_set.wx_str());
+ #else
EV_DBGLOG(_T("EnvVars: Obtained '%s' as active envvar set from config."), active_set.c_str());
+ #endif
return active_set;
}// GetActiveSetName
@@ -213,7 +217,11 @@
#endif
wxArrayString envvars;
+ #if wxCHECK_VERSION(2, 9, 0)
+ EV_DBGLOG(_T("EnvVars: Searching for envvars in path '%s'."), set_path.wx_str());
+ #else
EV_DBGLOG(_T("EnvVars: Searching for envvars in path '%s'."), set_path.c_str());
+ #endif
ConfigManager *cfg = Manager::Get()->GetConfigManager(_T("envvars"));
if (!cfg || set_path.IsEmpty())
@@ -230,7 +238,11 @@
EV_DBGLOG(_T("EnvVars: Warning: empty envvar detected and skipped."));
}
EV_DBGLOG(_T("EnvVars: Read %d/%d envvars in path '%s'."),
+ #if wxCHECK_VERSION(2, 9, 0)
+ envvars.GetCount(), num_envvars, set_path.wx_str());
+ #else
envvars.GetCount(), num_envvars, set_path.c_str());
+ #endif
return envvars;
}// GetEnvvarsBySetPath
@@ -346,9 +358,19 @@
if (!wxUnsetEnv(the_key))
{
Manager::Get()->GetLogManager()->Log(F(
- _("Unsetting environment variable '%s' failed."), the_key.c_str()));
+ _("Unsetting environment variable '%s' failed."),
+ #if wxCHECK_VERSION(2, 9, 0)
+ the_key.wx_str())
+ #else
+ the_key.c_str())
+ #endif
+ );
EV_DBGLOG(_T("EnvVars: Unsetting environment variable '%s' failed."),
+ #if wxCHECK_VERSION(2, 9, 0)
+ the_key.wx_str());
+ #else
the_key.c_str());
+ #endif
return false;
}
@@ -386,7 +408,11 @@
if (value_set.Contains(recursion))
{
EV_DBGLOG(_T("EnvVars: Setting environment variable '%s' failed "
+ #if wxCHECK_VERSION(2, 9, 0)
+ "due to unsresolvable recursion."), the_key.wx_str());
+ #else
"due to unsresolvable recursion."), the_key.c_str());
+ #endif
if (lstEnvVars && (sel>=0))
lstEnvVars->Check(sel, false); // Unset to visualise it's NOT set
return false;
@@ -396,10 +422,18 @@
}
Manager::Get()->GetMacrosManager()->ReplaceMacros(the_value);
+ #if wxCHECK_VERSION(2, 9, 0)
+ EV_DBGLOG(_T("EnvVars: Trying to set environment variable '%s' to value '%s'..."), the_key.wx_str(), the_value.wx_str());
+ #else
EV_DBGLOG(_T("EnvVars: Trying to set environment variable '%s' to value '%s'..."), the_key.c_str(), the_value.c_str());
+ #endif
if (!wxSetEnv(the_key, the_value))
{
+ #if wxCHECK_VERSION(2, 9, 0)
+ EV_DBGLOG(_T("EnvVars: Setting environment variable '%s' failed."), the_key.wx_str());
+ #else
EV_DBGLOG(_T("EnvVars: Setting environment variable '%s' failed."), the_key.c_str());
+ #endif
if (lstEnvVars && (sel>=0))
lstEnvVars->Check(sel, false); // Unset to visualise it's NOT set
return false;
@@ -470,14 +504,22 @@
if (!even_if_active && set_to_apply.IsSameAs(last_set_applied))
{
EV_DBGLOG(_T("EnvVars: Set '%s' will not be applied (already active)."),
+ #if wxCHECK_VERSION(2, 9, 0)
+ set_to_apply.wx_str());
+ #else
set_to_apply.c_str());
+ #endif
return;
}
// Show currently activated set in debug log (for reference)
wxString set_path = nsEnvVars::GetSetPathByName(set_to_apply);
EV_DBGLOG(_T("EnvVars: Active envvar set is '%s', config path '%s'."),
+ #if wxCHECK_VERSION(2, 9, 0)
+ set_to_apply.wx_str(), set_path.wx_str());
+ #else
set_to_apply.c_str(), set_path.c_str());
+ #endif
// Read and apply all envvars from currently active set in config
wxArrayString vars = nsEnvVars::GetEnvvarsBySetPath(set_path);
@@ -490,8 +532,14 @@
if (nsEnvVars::EnvvarArrayApply(var_array))
envvars_applied++;
else
+ {
EV_DBGLOG(_T("EnvVars: Invalid envvar in '%s' at position #%d."),
+ #if wxCHECK_VERSION(2, 9, 0)
+ set_path.wx_str(), i);
+ #else
set_path.c_str(), i);
+ #endif
+ }
}// for
if (envvars_total>0)
@@ -522,7 +570,11 @@
// Show currently activated set in debug log (for reference)
wxString set_path = nsEnvVars::GetSetPathByName(set_to_discard);
EV_DBGLOG(_T("EnvVars: Active envvar set is '%s', config path '%s'."),
+ #if wxCHECK_VERSION(2, 9, 0)
+ set_to_discard.wx_str(), set_path.wx_str());
+ #else
set_to_discard.c_str(), set_path.c_str());
+ #endif
// Read and apply all envvars from currently active set in config
wxArrayString vars = nsEnvVars::GetEnvvarsBySetPath(set_path);
@@ -540,8 +592,14 @@
envvars_discarded++;
}
else
+ {
EV_DBGLOG(_T("EnvVars: Invalid envvar in '%s' at position #%d."),
+ #if wxCHECK_VERSION(2, 9, 0)
+ set_path.wx_str(), i);
+ #else
set_path.c_str(), i);
+ #endif
+ }
}// for
if (envvars_total>0)
--- End code ---
MortenMacFly:
--- Quote from: stahta01 on June 19, 2009, 02:03:41 am ---Patch needed for lib_finder
--- End quote ---
For this patch I receive:
patching file "src/plugins/contrib/lib_finder/lib_finder.cpp"
patching file "src/plugins/contrib/lib_finder/defsdownloaddlg.cpp"
patch unexpectedly ends in middle of line
Please try to re-submit.
MortenMacFly:
--- Quote from: stahta01 on June 19, 2009, 02:04:39 am ---Patch needed for envvars
--- End quote ---
Applied in trunk. I've taken that one because I am testing a new version of this plugin currently. Thanks!
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version