Source-Changes-HG archive

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

[src/trunk]: src/sys/sys Add a __static_cast() macro to help standard headers...



details:   https://anonhg.NetBSD.org/src/rev/a69bac0f0943
branches:  trunk
changeset: 509507:a69bac0f0943
user:      kleink <kleink%NetBSD.org@localhost>
date:      Sun May 06 14:04:58 2001 +0000

description:
Add a __static_cast() macro to help standard headers when used in C++
compile environments using G++'s -Wold-style-cast warning;
suggested by Dave Sainty in PR lib/11766.

diffstat:

 sys/sys/cdefs.h |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (25 lines):

diff -r 290b15bb29f5 -r a69bac0f0943 sys/sys/cdefs.h
--- a/sys/sys/cdefs.h   Sun May 06 14:00:03 2001 +0000
+++ b/sys/sys/cdefs.h   Sun May 06 14:04:58 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cdefs.h,v 1.40 2000/12/27 10:05:22 kleink Exp $        */
+/*     $NetBSD: cdefs.h,v 1.41 2001/05/06 14:04:58 kleink Exp $        */
 
 /*
  * Copyright (c) 1991, 1993
@@ -68,11 +68,13 @@
 #endif
 
 #if defined(__cplusplus)
-#define        __BEGIN_DECLS   extern "C" {
-#define        __END_DECLS     };
+#define        __BEGIN_DECLS           extern "C" {
+#define        __END_DECLS             };
+#define        __static_cast(x,y)      static_cast<x>(y)
 #else
 #define        __BEGIN_DECLS
 #define        __END_DECLS
+#define        __static_cast(x,y)      (x)y
 #endif
 
 /*



Home | Main Index | Thread Index | Old Index