Fix non-XR orange from bug 319843 - Don't assume that we're using all of the new nsXULAppAPI features.

This commit is contained in:
benjamin%smedbergs.us 2006-08-17 15:37:22 +00:00
parent 5e75baaf42
commit c62f361ad2
5 changed files with 22 additions and 19 deletions

View File

@ -44,7 +44,7 @@
#include "nsBuildID.h"
static const nsXREAppData kAppData = {
sizeof(nsXREAppData),
offsetof(nsXREAppData, xreDirectory),
nsnull,
"Mozilla",
"Firefox",

View File

@ -46,7 +46,7 @@
#include <string.h>
static const nsXREAppData kAppData = {
sizeof(nsXREAppData),
offsetof(nsXREAppData, xreDirectory),
nsnull,
"Mozilla",
"Sunbird",

View File

@ -45,7 +45,7 @@
#include "prtypes.h"
static const nsXREAppData kAppData = {
sizeof(nsXREAppData),
offsetof(nsXREAppData, xreDirectory),
nsnull,
nsnull,
"Thunderbird",

View File

@ -45,7 +45,7 @@
#include "prtypes.h"
static const nsXREAppData kAppData = {
sizeof(nsXREAppData),
offsetof(nsXREAppData, xreDirectory),
nsnull,
"mozilla.org",
"SeaMonkey",

View File

@ -1973,23 +1973,26 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
Output(PR_TRUE, "Error: App:BuildID not specified in application.ini\n");
return 1;
}
if (!appData.minVersion) {
Output(PR_TRUE, "Error: Gecko:MinVersion not specified in application.ini\n");
return 1;
}
if (!appData.maxVersion) {
// If no maxVersion is specified, we assume the app is only compatible
// with the initial preview release. Do not increment this number ever!
SetAllocatedString(appData.maxVersion, "1.*");
}
if (appData.size > offsetof(nsXREAppData, minVersion)) {
if (!appData.minVersion) {
Output(PR_TRUE, "Error: Gecko:MinVersion not specified in application.ini\n");
return 1;
}
if (NS_CompareVersions(appData.minVersion, TOOLKIT_EM_VERSION) > 0 ||
NS_CompareVersions(appData.maxVersion, TOOLKIT_EM_VERSION) < 0) {
Output(PR_TRUE, "Error: Platform version " TOOLKIT_EM_VERSION " is not compatible with\n"
"minVersion >= %s\nmaxVersion <= %s\n",
appData.minVersion, appData.maxVersion);
return 1;
if (!appData.maxVersion) {
// If no maxVersion is specified, we assume the app is only compatible
// with the initial preview release. Do not increment this number ever!
SetAllocatedString(appData.maxVersion, "1.*");
}
if (NS_CompareVersions(appData.minVersion, TOOLKIT_EM_VERSION) > 0 ||
NS_CompareVersions(appData.maxVersion, TOOLKIT_EM_VERSION) < 0) {
Output(PR_TRUE, "Error: Platform version " TOOLKIT_EM_VERSION " is not compatible with\n"
"minVersion >= %s\nmaxVersion <= %s\n",
appData.minVersion, appData.maxVersion);
return 1;
}
}
if (!appData.xreDirectory) {