]> git.lyx.org Git - lyx.git/commitdiff
Add a static assert to prevent compilation on platforms where int/usigned int are...
authorVincent van Ravesteijn <vfr@lyx.org>
Fri, 5 Nov 2010 16:51:09 +0000 (16:51 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Fri, 5 Nov 2010 16:51:09 +0000 (16:51 +0000)
This is added to be sure that the to-be-added author hash is always 32-bit.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36126 a592a061-630c-0410-9148-cb99ea01b6c8

src/support/os.cpp

index 6984d2c7480fbfd43fe0079716d7eab4252a370d..820f4e9a66be3b8c32b4362843657b530230c629 100644 (file)
 #include "support/os_unix.cpp"
 #endif
 
+// Static assert to break compilation on platforms where
+// int/unsigned int is not 4 bytes. Added to make sure that
+// e.g., the author hash is always 32-bit.
+template<bool Condition> struct static_assert_helper;
+template <> struct static_assert_helper<true> {};
+enum { 
+       dummy = sizeof(static_assert_helper<sizeof(int) == 4>)
+};
+
 namespace lyx {
 namespace support {
 namespace os {