From a4fd2943735e25594961d60493e3bd7f003f6551 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Fri, 5 Nov 2010 16:51:09 +0000 Subject: [PATCH] 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 --- src/support/os.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) 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 { -- 2.39.2