Return-Path: MIME-Version: 1.0 In-Reply-To: <1330953167.3457.13.camel@pohly-mobl1.fritz.box> References: <1326708715.3360.135.camel@pohly-mobl1.fritz.box> <1330903638.3392.141.camel@aeonflux> <1330932819.4028.59.camel@pohly-mobl1.fritz.box> <1330953167.3457.13.camel@pohly-mobl1.fritz.box> Date: Mon, 5 Mar 2012 15:53:19 +0100 Message-ID: Subject: Re: [PATCH] bluetooth.h: fix compile issue when using in C++ From: Markus Rathgeb To: Patrick Ohly Cc: Marcel Holtmann , linux-bluetooth@vger.kernel.org Content-Type: text/plain; charset=UTF-8 List-ID: 2012/3/5 Patrick Ohly : > I'm fine with using __typeof__ instead of typeof. I verified that g++ > 4.6.2 and clang++ 3.0 grok __typeof__, with and without -std=c++0x. I > also checked that gcc accepts it without -std, with -std=gnu89, and with > -std=c99. It rejects the header file with -std=c89 because of the inline > keyword. The gcc documentation states also this for the typeof C extension: "If you are writing a header file that must work when included in ISO C programs, write __typeof__ instead of typeof." Source: http://gcc.gnu.org/onlinedocs/gcc/Typeof.html