Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/bind/dist/lib/isc/include/isc Some versions of ...



details:   https://anonhg.NetBSD.org/src/rev/80c1f3ec57b4
branches:  trunk
changeset: 769542:80c1f3ec57b4
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Sep 13 19:07:44 2011 +0000

description:
Some versions of linux have probably marked fwrite(3) as
__attribute__((__warn_unused_result__)) and the __builtin_expect()
use here is an attempt to silence the warning. This does not work
if the second argument of __builtin_expect() is not a constant,
but we are not linux, so instead of going through the
__builtin_constant_p() dance to correct this, just disable it for
non linux OS's.

diffstat:

 external/bsd/bind/dist/lib/isc/include/isc/util.h |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 9378d2da6fdf -r 80c1f3ec57b4 external/bsd/bind/dist/lib/isc/include/isc/util.h
--- a/external/bsd/bind/dist/lib/isc/include/isc/util.h Tue Sep 13 18:09:52 2011 +0000
+++ b/external/bsd/bind/dist/lib/isc/include/isc/util.h Tue Sep 13 19:07:44 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: util.h,v 1.5 2011/09/11 18:55:42 christos Exp $        */
+/*     $NetBSD: util.h,v 1.6 2011/09/13 19:07:44 christos Exp $        */
 
 /*
  * Copyright (C) 2004-2007, 2010, 2011  Internet Systems Consortium, Inc. ("ISC")
@@ -240,7 +240,7 @@
 /*%
  * Prevent Linux spurious warnings
  */
-#if defined(__GNUC__) && (__GNUC__ > 3)
+#if defined(__linux__) && defined(__GNUC__) && (__GNUC__ > 3)
 #define isc_util_fwrite(a, b, c, d)    \
        __builtin_expect(fwrite((a), (b), (c), (d)), (c))
 #else



Home | Main Index | Thread Index | Old Index