summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-03-09 12:49:26 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-08-13 08:05:16 +0200
commit3a7a2012e16a3f5bcb9be42c4e3a78718216c862 (patch)
tree32b702e9f15728a653a901dbe994eaaa7857649b
parent5eea2a12e6a1048df66a9f607ca4d7087c8fb0c1 (diff)
WaE: Use BOOST_STATIC_ASSERT
(cherry picked from commit e4b99f5d445903e1309c301cc327d2dfb23d8d71) Change-Id: Ib9dc2541c3bf72ddd6094331297a91352138e5af Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--store/Library_store.mk2
-rw-r--r--store/source/storbase.hxx21
-rw-r--r--store/source/storbios.cxx5
-rw-r--r--store/source/storcach.cxx7
-rw-r--r--store/source/stordata.hxx9
-rw-r--r--store/source/stortree.hxx5
-rw-r--r--store/workben/t_page.cxx5
7 files changed, 29 insertions, 25 deletions
diff --git a/store/Library_store.mk b/store/Library_store.mk
index f66c1ebce6db..11c822e17e90 100644
--- a/store/Library_store.mk
+++ b/store/Library_store.mk
@@ -28,6 +28,8 @@ $(eval $(call gb_Library_Library,store))
$(eval $(call gb_Library_set_soversion_script,store,3,$(SRCDIR)/store/util/store.map))
+$(eval $(call gb_Library_use_external,store,boost_headers))
+
$(eval $(call gb_Library_use_packages,store,\
store_inc \
))
diff --git a/store/source/storbase.hxx b/store/source/storbase.hxx
index 7c07dbad0cf1..cbd4fc55a888 100644
--- a/store/source/storbase.hxx
+++ b/store/source/storbase.hxx
@@ -20,6 +20,9 @@
#ifndef _STORE_STORBASE_HXX_
#define _STORE_STORBASE_HXX_
+#include "sal/config.h"
+
+#include "boost/static_assert.hpp"
#include "sal/types.h"
#include "rtl/alloc.h"
@@ -49,22 +52,6 @@
#define STORE_IMPL_CONCAT2(x, y) x##y
#endif
-#ifndef STORE_STATIC_ASSERT /* Compile time assertion */
-namespace store
-{
- template< bool x > struct STATIC_ASSERTION_FAILURE;
- template<> struct STATIC_ASSERTION_FAILURE< true > { enum { value = 1 }; };
-
- template< int x > struct static_assert_test{};
-} // namespace store
-
-#define STORE_STATIC_ASSERT(pred) \
-typedef \
-store::static_assert_test< sizeof( store::STATIC_ASSERTION_FAILURE< (bool)(pred) > ) > \
-STORE_IMPL_CONCAT(static_assert_typedef_, __LINE__)
-
-#endif /* !STORE_STATIC_ASSERT */
-
namespace store
{
@@ -437,7 +424,7 @@ struct PageData
*/
static const size_t theSize = sizeof(G) + sizeof(D) + 2 * sizeof(L);
static const sal_uInt16 thePageSize = theSize;
- STORE_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= thePageSize);
+ BOOST_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= thePageSize);
/** location.
*/
diff --git a/store/source/storbios.cxx b/store/source/storbios.cxx
index 2cdbecee9b33..b773c5d20397 100644
--- a/store/source/storbios.cxx
+++ b/store/source/storbios.cxx
@@ -17,6 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include "sal/config.h"
+
+#include "boost/static_assert.hpp"
#include "storbios.hxx"
@@ -182,7 +185,7 @@ struct SuperBlockPage
*/
static const size_t theSize = 2 * SuperBlock::theSize;
static const sal_uInt16 thePageSize = theSize;
- STORE_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= thePageSize);
+ BOOST_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= thePageSize);
/** Allocation.
*/
diff --git a/store/source/storcach.cxx b/store/source/storcach.cxx
index e07aa7f1791c..481177e0c831 100644
--- a/store/source/storcach.cxx
+++ b/store/source/storcach.cxx
@@ -17,6 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include "sal/config.h"
+
+#include "boost/static_assert.hpp"
#include "storcach.hxx"
@@ -256,7 +259,7 @@ class PageCache_Impl :
/** Representation.
*/
static size_t const theTableSize = 32;
- STORE_STATIC_ASSERT(STORE_IMPL_ISP2(theTableSize));
+ BOOST_STATIC_ASSERT(STORE_IMPL_ISP2(theTableSize));
Entry ** m_hash_table;
Entry * m_hash_table_0[theTableSize];
@@ -330,7 +333,7 @@ PageCache_Impl::PageCache_Impl (sal_uInt16 nPageSize)
m_nMissed (0)
{
static size_t const theSize = SAL_N_ELEMENTS(m_hash_table_0);
- STORE_STATIC_ASSERT(theSize == theTableSize);
+ BOOST_STATIC_ASSERT(theSize == theTableSize);
memset(m_hash_table_0, 0, sizeof(m_hash_table_0));
}
diff --git a/store/source/stordata.hxx b/store/source/stordata.hxx
index cbd004482e47..88f8f74acb41 100644
--- a/store/source/stordata.hxx
+++ b/store/source/stordata.hxx
@@ -20,6 +20,9 @@
#ifndef _STORE_STORDATA_HXX_
#define _STORE_STORDATA_HXX_
+#include "sal/config.h"
+
+#include "boost/static_assert.hpp"
#include "sal/types.h"
#include "sal/macros.h"
@@ -55,7 +58,7 @@ struct OStoreDataPageData : public store::OStorePageData
*/
static const size_t theSize = 0;
static const sal_uInt16 thePageSize = base::theSize + self::theSize;
- STORE_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= self::thePageSize);
+ BOOST_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= self::thePageSize);
/** capacity.
*/
@@ -145,7 +148,7 @@ struct OStoreIndirectionPageData : public store::OStorePageData
*/
static const size_t theSize = sizeof(G);
static const sal_uInt16 thePageSize = base::theSize + self::theSize;
- STORE_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= self::thePageSize);
+ BOOST_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= self::thePageSize);
/** capacity.
*/
@@ -570,7 +573,7 @@ struct OStoreDirectoryPageData : public store::OStorePageData
*/
static const size_t theSize = NameBlock::theSize + DataBlock::theSize;
static const sal_uInt16 thePageSize = base::theSize + self::theSize;
- STORE_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= self::thePageSize);
+ BOOST_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= self::thePageSize);
/** capacity.
*/
diff --git a/store/source/stortree.hxx b/store/source/stortree.hxx
index f057bac79588..54768a1d0008 100644
--- a/store/source/stortree.hxx
+++ b/store/source/stortree.hxx
@@ -20,6 +20,9 @@
#ifndef _STORE_STORTREE_HXX
#define _STORE_STORTREE_HXX
+#include "sal/config.h"
+
+#include "boost/static_assert.hpp"
#include "sal/types.h"
#include "store/types.h"
@@ -120,7 +123,7 @@ struct OStoreBTreeNodeData : public store::OStorePageData
*/
static const size_t theSize = sizeof(G);
static const sal_uInt16 thePageSize = base::theSize + self::theSize;
- STORE_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= self::thePageSize);
+ BOOST_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= self::thePageSize);
/** capacity.
*/
diff --git a/store/workben/t_page.cxx b/store/workben/t_page.cxx
index 83be15044d98..9aa5fd71ac4a 100644
--- a/store/workben/t_page.cxx
+++ b/store/workben/t_page.cxx
@@ -17,6 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include "sal/config.h"
+
+#include "boost/static_assert.hpp"
#include "osl/diagnose.h"
#include "rtl/alloc.h"
#include "rtl/ref.hxx"
@@ -156,7 +159,7 @@ struct PageData
*/
static const size_t theSize = sizeof(G) + sizeof(D) + 2 * sizeof(L);
static const sal_uInt16 thePageSize = theSize;
- STORE_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= thePageSize);
+ BOOST_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= thePageSize);
/** type.
*/