My favorites | Sign in
Project Home Downloads Wiki Issues Code Search
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 347123: Chromium fails to build on FreeBSD 9.2 as safe_sprintf.cc Mac/Andriod workaround needs to be applied there too
3 people starred this issue and may be notified of changes. Back to list
Status:  Unconfirmed
Owner:  cmp-bugs@chromium.org


Sign in to add a comment
 
Reported by carpedd...@gmail.com, Feb 26, 2014
Chrome Version       : 33.0.1750.117

--- ./work/chromium-33.0.1750.117/base/strings/safe_sprintf.cc  2014-02-20 15:28:45.000000000 -0500
+++ /tmp/safe_sprintf.cc        2014-02-26 09:17:33.000000000 -0500
@@ -107,11 +107,11 @@
       : buffer_(buffer),
         size_(size - 1),  // Account for trailing NUL byte
         count_(0) {
-// The following assertion does not build on Mac and Android. This is because
-// static_assert only works with compile-time constants, but mac uses
-// libstdc++4.2 and android uses stlport, which both don't mark
-// numeric_limits::max() as constexp.
-#if __cplusplus >= 201103 && !defined(OS_ANDROID) && !defined(OS_MACOSX) && !defined(OS_IOS)
+// The following assertion does not build on Mac, Android and older FreeBSD.
+// This is because static_assert only works with compile-time constants, but
+// Mac and FreeBSD < 10 use libstdc++4.2 and android uses stlport, which both
+// don't mark numeric_limits::max() as constexp.
+#if __cplusplus >= 201103 && !defined(OS_ANDROID) && !defined(OS_MACOSX) && !defined(OS_IOS) && !defined(OS_FREEBSD)
     COMPILE_ASSERT(kSSizeMaxConst == \
                    static_cast<size_t>(std::numeric_limits<ssize_t>::max()),
                    kSSizeMax_is_the_max_value_of_an_ssize_t);

Feb 26, 2014
#1 meh...@chromium.org
(No comment was entered for this change.)
Labels: Build
Mar 7, 2014
#2 r.c.la...@gmail.com
How about changing the !defined(OS_FREEBSD) conditional to !(defined(OS_FREEBSD) && __FreeBSD_version > 1000054) ?

This allows the assert to compile on recent versions of FreeBSD.

You might need to include <sys/param.h> (I managed to compile it without).
Sign in to add a comment

Powered by Google Project Hosting