Fixed optional dependencies logging errors (again) (bug 5739, r=dvander).
authorsystematicmania <systematicmania@gmail.com>
Sat Aug 24 00:12:21 2013 -0400 (2013-08-24)
changeset 40452891bbc5932b
parent 4044 a44d2b556b96
child 4046 56a4c27831fe
Fixed optional dependencies logging errors (again) (bug 5739, r=dvander).

Regression from changeset 4c93f74cae51 and changeset 7dae5b0b8e28 in bug 5860.
core/logic/ExtensionSys.cpp
core/logic/ExtensionSys.h
core/logic/PluginSys.cpp
core/logic/intercom.h
     1.1 --- a/core/logic/ExtensionSys.cpp	Fri Aug 23 18:48:06 2013 -0400
     1.2 +++ b/core/logic/ExtensionSys.cpp	Sat Aug 24 00:12:21 2013 -0400
     1.3 @@ -577,7 +577,7 @@
     1.4  	}
     1.5  }
     1.6  
     1.7 -IExtension *CExtensionManager::LoadAutoExtension(const char *path)
     1.8 +IExtension *CExtensionManager::LoadAutoExtension(const char *path, bool bErrorOnMissing)
     1.9  {
    1.10  	/* Remove platform extension if it's there. Compat hack. */
    1.11  	const char *ext = libsys->GetFileExtension(path);
    1.12 @@ -586,7 +586,7 @@
    1.13  		char path2[PLATFORM_MAX_PATH];
    1.14  		smcore.Format(path2, sizeof(path2), "%s", path);
    1.15  		path2[strlen(path) - strlen(PLATFORM_LIB_EXT) - 1] = '\0';
    1.16 -		return LoadAutoExtension(path2);
    1.17 +		return LoadAutoExtension(path2, bErrorOnMissing);
    1.18  	}
    1.19  
    1.20  	IExtension *pAlready;
    1.21 @@ -605,7 +605,11 @@
    1.22  
    1.23  	if (!p->Load(error, sizeof(error)) || !p->IsLoaded())
    1.24  	{
    1.25 -		smcore.LogError("[SM] Unable to load extension \"%s\": %s", path, error);
    1.26 +		if (bErrorOnMissing || libsys->IsPathFile(p->GetPath()))
    1.27 +		{
    1.28 +			smcore.LogError("[SM] Unable to load extension \"%s\": %s", path, error);
    1.29 +		}
    1.30 +		
    1.31  		p->SetError(error);
    1.32  	}
    1.33  
     2.1 --- a/core/logic/ExtensionSys.h	Fri Aug 23 18:48:06 2013 -0400
     2.2 +++ b/core/logic/ExtensionSys.h	Sat Aug 24 00:12:21 2013 -0400
     2.3 @@ -164,7 +164,7 @@
     2.4  public: //IRootConsoleCommand
     2.5  	void OnRootConsoleCommand(const char *cmdname, const CCommand &command);
     2.6  public:
     2.7 -	IExtension *LoadAutoExtension(const char *path);
     2.8 +	IExtension *LoadAutoExtension(const char *path, bool bErrorOnMissing=true);
     2.9  	void BindDependency(IExtension *pOwner, IfaceInfo *pInfo);
    2.10  	void AddInterface(IExtension *pOwner, SMInterface *pInterface);
    2.11  	void BindChildPlugin(IExtension *pParent, SMPlugin *pPlugin);
     3.1 --- a/core/logic/PluginSys.cpp	Fri Aug 23 18:48:06 2013 -0400
     3.2 +++ b/core/logic/PluginSys.cpp	Sat Aug 24 00:12:21 2013 -0400
     3.3 @@ -1286,7 +1286,7 @@
     3.4  				{
     3.5  					libsys->PathFormat(path, PLATFORM_MAX_PATH, "%s", file);
     3.6  					bool bErrorOnMissing = ext->required ? true : false;
     3.7 -					g_Extensions.LoadAutoExtension(path);
     3.8 +					g_Extensions.LoadAutoExtension(path, bErrorOnMissing);
     3.9  				}
    3.10  			}
    3.11  			else if (pass == 2)
     4.1 --- a/core/logic/intercom.h	Fri Aug 23 18:48:06 2013 -0400
     4.2 +++ b/core/logic/intercom.h	Sat Aug 24 00:12:21 2013 -0400
     4.3 @@ -49,7 +49,7 @@
     4.4   * Add 1 to the RHS of this expression to bump the intercom file
     4.5   * This is to prevent mismatching core/logic binaries
     4.6   */
     4.7 -#define SM_LOGIC_MAGIC		(0x0F47C0DE - 23)
     4.8 +#define SM_LOGIC_MAGIC		(0x0F47C0DE - 24)
     4.9  
    4.10  #if defined SM_LOGIC
    4.11  class IVEngineServer
    4.12 @@ -164,7 +164,7 @@
    4.13  class IExtensionSys : public IExtensionManager
    4.14  {
    4.15  public:
    4.16 -	virtual IExtension *LoadAutoExtension(const char *name) = 0;
    4.17 +	virtual IExtension *LoadAutoExtension(const char *name, bool bErrorOnMissing=true) = 0;
    4.18  	virtual void TryAutoload() = 0;
    4.19  	virtual void Shutdown() = 0;
    4.20  	virtual IExtension *FindExtensionByFile(const char *name) = 0;