From owner-freebsd-current@FreeBSD.ORG Fri Feb 13 18:25:35 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1DAC106566B for ; Fri, 13 Feb 2009 18:25:35 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 192DE8FC08 for ; Fri, 13 Feb 2009 18:25:34 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA12620 for ; Fri, 13 Feb 2009 20:25:32 +0200 (EET) (envelope-from avg@icyb.net.ua) Message-ID: <4995BB1B.7060201@icyb.net.ua> Date: Fri, 13 Feb 2009 20:25:31 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.19 (X11/20090110) MIME-Version: 1.0 To: freebsd-current@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: weeding out c++ keywords from sys/sys X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 18:25:36 -0000 Proposal: Make header files in sys/sys C++-friendly. Rationale: There are people who write FreeBSD drivers in C++, the driver code needs to include some headers from sys/sys and it causes some pain if the headers contain reserved C++ keywords. Scope: Very limited. This is not about making the whole kernel compilable by a C++ compiler. And not about making all sources "future"-proof, just about making life a little bit easier for a few fellows. Efforts: Non-trivial effort would be needed only for conflicts in types/fields definitions. Function params for prototypes and typedef are low hanging fruits. Start: diff --git a/sys/sys/conf.h b/sys/sys/conf.h index 9d8da2c..b7f9df6 100644 --- a/sys/sys/conf.h +++ b/sys/sys/conf.h @@ -145,7 +145,7 @@ typedef int d_spare2_t(struct cdev *dev); typedef int dumper_t( void *priv, /* Private to the driver. */ - void *virtual, /* Virtual (mapped) address. */ + void *virt, /* Virtual (mapped) address. */ vm_offset_t physical, /* Physical address of virtual. */ off_t offset, /* Byte-offset to write at. */ size_t length); /* Number of bytes to dump. */ diff --git a/sys/sys/lock_profile.h b/sys/sys/lock_profile.h index f2861ac..7e7f666 100644 --- a/sys/sys/lock_profile.h +++ b/sys/sys/lock_profile.h @@ -160,7 +160,7 @@ static inline void lock_profile_obtain_lock_failed(struct lock_object *lo, int * static inline void lock_profile_obtain_lock_success(struct lock_object *lo, int contested, uint64_t waittime, const char *file, int line) {;} static inline void lock_profile_object_destroy(struct lock_object *lo) {;} -static inline void lock_profile_object_init(struct lock_object *lo, struct lock_class *class, const char *name) {;} +static inline void lock_profile_object_init(struct lock_object *lo, struct lock_class *clazz, const char *name) {;} #endif /* _KERNEL */ -- Andriy Gapon