From 1d36d91d0a1814ba209e683f74658a92e167a73f Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 23 Jul 2014 22:58:49 +0200 Subject: [PATCH] use BOOST_STATIC_ASSERT for sizeof check Change-Id: Iad00aa47ef65fe163eff407549c26eb3590ab132 --- stoc/Library_javaloader.mk | 2 ++ stoc/source/javaloader/javaloader.cxx | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/stoc/Library_javaloader.mk b/stoc/Library_javaloader.mk index 3d191f979902..cce32f8277e8 100644 --- a/stoc/Library_javaloader.mk +++ b/stoc/Library_javaloader.mk @@ -9,6 +9,8 @@ $(eval $(call gb_Library_Library,javaloader)) +$(eval $(call gb_Library_use_external,javaloader,boost_headers)) + $(eval $(call gb_Library_use_udk_api,javaloader)) $(eval $(call gb_Library_use_libraries,javaloader,\ diff --git a/stoc/source/javaloader/javaloader.cxx b/stoc/source/javaloader/javaloader.cxx index 335356ad39d5..477ffa5c90fd 100644 --- a/stoc/source/javaloader/javaloader.cxx +++ b/stoc/source/javaloader/javaloader.cxx @@ -18,6 +18,9 @@ */ #include + +#include + #include #include @@ -155,9 +158,8 @@ const css::uno::Reference & JavaComponentLoader::getJavaL // as long as our reference to the XJavaVM service lasts), and // convert the non-refcounted pointer into a refcounted one // immediately: - OSL_ENSURE(sizeof (sal_Int64) - >= sizeof (jvmaccess::UnoVirtualMachine *), - "Pointer cannot be represented as sal_Int64"); + BOOST_STATIC_ASSERT(sizeof (sal_Int64) + >= sizeof (jvmaccess::UnoVirtualMachine *)); sal_Int64 nPointer = reinterpret_cast< sal_Int64 >( static_cast< jvmaccess::UnoVirtualMachine * >(0)); javaVM_xJavaVM->getJavaVM(processID) >>= nPointer;