From: Vincent van Ravesteijn Date: Fri, 5 Nov 2010 16:51:09 +0000 (+0000) Subject: Add a static assert to prevent compilation on platforms where int/usigned int are... X-Git-Tag: 2.0.0~1991 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=a4fd2943735e25594961d60493e3bd7f003f6551;p=features.git Add a static assert to prevent compilation on platforms where int/usigned int are not 32-bits/4-bytes. 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 --- diff --git a/src/support/os.cpp b/src/support/os.cpp index 6984d2c748..820f4e9a66 100644 --- a/src/support/os.cpp +++ b/src/support/os.cpp @@ -18,6 +18,15 @@ #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 struct static_assert_helper; +template <> struct static_assert_helper {}; +enum { + dummy = sizeof(static_assert_helper) +}; + namespace lyx { namespace support { namespace os {