jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx | 28 +++++++++++------------ jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx | 11 ++------- 2 files changed, 17 insertions(+), 22 deletions(-)
New commits: commit 91fcd999225e8525dc1765787cb110600cc92d48 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Mon Feb 4 14:20:33 2019 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Mon Feb 4 15:54:22 2019 +0100 Get rid of some macros Change-Id: I9bbb1e41a687b62b32ed00f1c7cf5d82d66b4915 Reviewed-on: https://gerrit.libreoffice.org/67360 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx index c9195fb4730f..60911f8a63ca 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx @@ -34,25 +34,25 @@ namespace jfw_plugin the string contains an a umlaut then it must be expressed by "\xXX\xXX" */ -BEGIN_VENDOR_MAP() +VendorSupportMapEntry const gVendorMap[] ={ // For macOS, don't bother with implementations that aren't relevant (or have never existed) #ifdef MACOSX - VENDOR_MAP_ENTRY("Apple Inc.", OtherInfo) - VENDOR_MAP_ENTRY("Apple Computer, Inc.", OtherInfo) + VENDOR_MAP_ENTRY<OtherInfo>("Apple Inc."), + VENDOR_MAP_ENTRY<OtherInfo>("Apple Computer, Inc."), #endif - VENDOR_MAP_ENTRY("Sun Microsystems Inc.", SunInfo) - VENDOR_MAP_ENTRY("Oracle Corporation", SunInfo) - VENDOR_MAP_ENTRY("AdoptOpenJdk", SunInfo) - VENDOR_MAP_ENTRY("Amazon.com Inc.", SunInfo) + VENDOR_MAP_ENTRY<SunInfo>("Sun Microsystems Inc."), + VENDOR_MAP_ENTRY<SunInfo>("Oracle Corporation"), + VENDOR_MAP_ENTRY<SunInfo>("AdoptOpenJdk"), + VENDOR_MAP_ENTRY<SunInfo>("Amazon.com Inc."), #ifndef MACOSX - VENDOR_MAP_ENTRY("IBM Corporation", OtherInfo) - VENDOR_MAP_ENTRY("Blackdown Java-Linux Team", OtherInfo) - VENDOR_MAP_ENTRY("BEA Systems, Inc.", OtherInfo) - VENDOR_MAP_ENTRY("Free Software Foundation, Inc.", GnuInfo) - VENDOR_MAP_ENTRY("The FreeBSD Foundation", OtherInfo) + VENDOR_MAP_ENTRY<OtherInfo>("IBM Corporation"), + VENDOR_MAP_ENTRY<OtherInfo>("Blackdown Java-Linux Team"), + VENDOR_MAP_ENTRY<OtherInfo>("BEA Systems, Inc."), + VENDOR_MAP_ENTRY<GnuInfo>("Free Software Foundation, Inc."), + VENDOR_MAP_ENTRY<OtherInfo>("The FreeBSD Foundation"), #endif - VENDOR_MAP_ENTRY("Azul Systems, Inc.", OtherInfo) -END_VENDOR_MAP() + VENDOR_MAP_ENTRY<OtherInfo>("Azul Systems, Inc."), + {nullptr, nullptr, nullptr} }; bool isVendorSupported(const OUString& sVendor) diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx index b6b1f3113545..10e3cec10518 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx @@ -37,14 +37,9 @@ struct VendorSupportMapEntry extern VendorSupportMapEntry const gVendorMap[]; -#define BEGIN_VENDOR_MAP() \ -VendorSupportMapEntry const gVendorMap[] ={ - -#define VENDOR_MAP_ENTRY(x,y) \ - {x, & y::getJavaExePaths, & y::createInstance}, - -#define END_VENDOR_MAP() \ - {nullptr, nullptr, nullptr} }; +template<typename y> constexpr VendorSupportMapEntry VENDOR_MAP_ENTRY(char const * x) { + return {x, & y::getJavaExePaths, & y::createInstance}; +} /* Examines if the vendor supplied in parameter sVendor is part of the list of supported vendors. That is the arry of VendorSupportMapEntry _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits