Module Name: src
Committed By: martin
Date: Tue Feb 21 10:53:08 UTC 2012
Modified Files:
src/sys/sys: cdefs.h
Log Message:
There are some places where C99 allows a restrict modifier (and posix
demands it), but C++ does not allow it. So add a C only version of
__restrict, which expands to nothing if compiling C++.
See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49347 for a discussion.
To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/sys/sys/cdefs.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/sys/cdefs.h
diff -u src/sys/sys/cdefs.h:1.90 src/sys/sys/cdefs.h:1.91
--- src/sys/sys/cdefs.h:1.90 Fri Feb 17 18:58:51 2012
+++ src/sys/sys/cdefs.h Tue Feb 21 10:53:08 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: cdefs.h,v 1.90 2012/02/17 18:58:51 joerg Exp $ */
+/* $NetBSD: cdefs.h,v 1.91 2012/02/21 10:53:08 martin Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -266,10 +266,13 @@
#define __BEGIN_EXTERN_C extern "C" {
#define __END_EXTERN_C }
#define __static_cast(x,y) static_cast<x>(y)
+/* C++ does not allow a __restrict modifier everywhere C99 does */
+#define __conly_restrict
#else
#define __BEGIN_EXTERN_C
#define __END_EXTERN_C
#define __static_cast(x,y) (x)y
+#define __conly_restrict __restrict
#endif
#if __GNUC_PREREQ__(4, 0)