Bug 296426 - nsIXULRuntime should provide build config info, r=darin a=asa

This commit is contained in:
bsmedberg%covad.net 2005-06-10 18:23:28 +00:00
parent 976c8ba53a
commit b511ffd3df
3 changed files with 45 additions and 2 deletions

View File

@ -180,7 +180,10 @@ endif
DEFINES += -DOS_TARGET=\"$(OS_TARGET)\"
ifdef TARGET_XPCOM_ABI
DEFINES += -DTARGET_OS_ABI=\"$(OS_TARGET)_$(TARGET_XPCOM_ABI)\"
DEFINES += \
-DTARGET_XPCOM_ABI=\"$(TARGET_XPCOM_ABI)\" \
-DTARGET_OS_ABI=\"$(OS_TARGET)_$(TARGET_XPCOM_ABI)\" \
$(NULL)
endif
export:: $(addprefix $(topsrcdir)/xpfe/bootstrap/, $(SHAREDCPPSRCS) $(SHAREDCMMSRCS)) $(STACKWALK_CPPSRCS)

View File

@ -461,6 +461,24 @@ nsXULAppInfo::GetInSafeMode(PRBool *aResult)
return NS_OK;
}
NS_IMETHODIMP
nsXULAppInfo::GetOS(nsACString& aResult)
{
aResult.AssignLiteral(OS_TARGET);
return NS_OK;
}
NS_IMETHODIMP
nsXULAppInfo::GetXPCOMABI(nsACString& aResult)
{
#ifdef TARGET_XPCOM_ABI
aResult.AssignLiteral(TARGET_XPCOM_ABI);
return NS_OK;
#else
return NS_ERROR_NOT_AVAILABLE;
#endif
}
NS_IMETHODIMP
nsXULAppInfo::CreateInstance(nsISupports* aOuter,
REFNSIID aIID,

View File

@ -44,7 +44,7 @@
* stable/frozen, please contact Benjamin Smedberg.
*/
[scriptable, uuid(B344A346-D2BF-11D9-A33B-001124787B2E)]
[scriptable, uuid(2848AB92-D912-11D9-89F7-001124787B2E)]
interface nsIXULRuntime : nsISupports
{
/**
@ -58,4 +58,26 @@ interface nsIXULRuntime : nsISupports
* proper UI, it should set this flag to "true".
*/
attribute boolean logConsoleErrors;
/**
* A string tag identifying the current operating system. This is taken
* from the OS_TARGET configure variable. It will always be available.
*/
readonly attribute AUTF8String OS;
/**
* A string tag identifying the binary ABI of the current processor and
* compiler vtable. This is taken from the TARGET_XPCOM_ABI configure
* variable. It may not be available on all platforms, especially
* unusual processor or compiler combinations.
*
* The result takes the form <processor>-<compilerABI>, for example:
* x86-msvc
* ppc-gcc3
*
* This value should almost always be used in combination with "OS".
*
* @throw NS_ERROR_NOT_AVAILABLE if not available.
*/
readonly attribute AUTF8String XPCOMABI;
};