From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-x22c.google.com (mail-wg0-x22c.google.com [IPv6:2a00:1450:400c:c00::22c]) by hurricane.the-brannons.com (Postfix) with ESMTPS id C731E77CD4 for ; Sun, 16 Feb 2014 12:41:26 -0800 (PST) Received: by mail-wg0-f44.google.com with SMTP id k14so1673001wgh.23 for ; Sun, 16 Feb 2014 12:40:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=1Hxz8NuiB/biQ8AvZU8iWaeXfy99auh0r82uyFnmG0M=; b=NUfYh1Gvv5fgJ0OMa/8TnJPdbA5Mjk6g4KM0l1cr04mo9o0jPLVHU42CKdN9PW3LbW JKkLYf3mK4pt8m64WRdNUQo2XOHfrWZijq9lJynRycO2NCCqSrHbyNsf7EMhuP7BMeIZ bklRE4a/vlN+K+oj+Ju3crQzT9FWzdfSoKwgDmMaJYBu9mqiwCUseVqiKb8sTxbSGQyG C6LXLFeqs2j+/mh3SkxLU014076tGUkQuPKzbUp7/DAwDHN5Ul4h+x1RmpksPurgUYgg Ze8R1ZPdcJmDpvAZzcyZzh8Q3HmEJ1ncrvL6xQYSXgyfBysFAc37gd0czeO132Sx7B2L wosg== X-Received: by 10.180.73.103 with SMTP id k7mr4349953wiv.24.1392583234185; Sun, 16 Feb 2014 12:40:34 -0800 (PST) Received: from toaster.adamthompson.me.uk (toaster.adamthompson.me.uk. [2001:8b0:1142:9042::2]) by mx.google.com with ESMTPSA id bj3sm31096044wjb.14.2014.02.16.12.40.32 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 16 Feb 2014 12:40:33 -0800 (PST) Date: Sun, 16 Feb 2014 20:40:25 +0000 From: Adam Thompson To: Karl Dahlke Message-ID: <20140216204025.GA28870@toaster.adamthompson.me.uk> References: <20140115035237.eklhad@comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140115035237.eklhad@comcast.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Edbrowse-dev@lists.the-brannons.com Subject: Re: [Edbrowse-dev] extern "C"{} X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.17 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 20:41:27 -0000 On Sat, Feb 15, 2014 at 03:52:37AM -0500, Karl Dahlke wrote: > I've seen it manyh times, but I don't understand what this does. > I would guess that the prototypes enclosed are C functions, > not C++, so the C++ compiler will call them with the C conventions. Yes, this construct prevents c++ name mangling, and is necessary for linking between c and c++ code. > That would make sense, but then > > 1. Couldn't we just put it around eb.p? > We don't really need it in eb.h. > That would let us indent eb.h if we like, and be a bit clearer perhaps. It depends if eb.p is ever regenerated, I guess this'd be a change in mkproto? > > 2. there are a few functions like set_global_property_string > that are C++ functions, but are declared in eb.p, in eb.h, > and inside extern "C"{}. > In fact this one is declared twice, in eb.p and ebjs.p, one inside extern "C"{} > and the other time not. > So I guess I don't know what this does, > and why we seem to get away with using it inconsistently. I was going to say that needed cleaning up but it looks like that's already been done. As for why it didn't explode, probably because the parts of the code using it were using the c++ signature (with the JS::handle stuff) and gcc is a fairly friendly compiler. Cheers, Adam.