summaryrefslogtreecommitdiff
path: root/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx')
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx26
1 files changed, 25 insertions, 1 deletions
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
index 9b580ccaa8fb..ef9da176ebc4 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
@@ -62,12 +62,14 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props)
OUString sVendorProperty("java.vendor");
OUString sVersionProperty("java.version");
OUString sHomeProperty("java.home");
+ OUString sArchProperty("os.arch");
OUString sAccessProperty("javax.accessibility.assistive_technologies");
bool bVersion = false;
bool bVendor = false;
bool bHome = false;
bool bAccess = false;
+ bool bArch = false;
typedef vector<pair<OUString, OUString> >::const_iterator it_prop;
for (it_prop i = props.begin(); i != props.end(); ++i)
@@ -103,6 +105,11 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props)
bHome = true;
#endif
}
+ else if (!bArch && sArchProperty.equals(i->first))
+ {
+ m_sArch = i->second;
+ bArch = true;
+ }
else if (!bAccess && sAccessProperty.equals(i->first))
{
if (!i->second.isEmpty())
@@ -115,7 +122,7 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props)
//must search through all properties.
}
- if (!bVersion || !bVendor || !bHome)
+ if (!bVersion || !bVendor || !bHome || !bArch)
return false;
// init m_sRuntimeLibrary
@@ -201,6 +208,23 @@ const OUString & VendorBase::getRuntimeLibrary() const
{
return m_sRuntimeLibrary;
}
+
+bool VendorBase::isValidArch() const
+{
+ // Warning: These values come from the "os.arch" property.
+ // It is not defined what the exact values are.
+ // Oracle JRE 8 has "x86" and "amd64", the others were found at http://lopica.sourceforge.net/os.html .
+ // There might still be missing some options; we need to extend the check once we find out.
+#if defined _WIN32
+ return m_sArch == "x86" || m_sArch == "i386" || m_sArch == "i686";
+#elif defined _WIN64
+ return m_sArch == "amd64" || m_sArch == "x86_64";
+#else
+ (void)this;
+ return true;
+#endif
+}
+
bool VendorBase::supportsAccessibility() const
{
return m_bAccessibility;