Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: (qmail 36452 invoked from network); 30 Nov 2010 14:58:40 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 30 Nov 2010 14:58:40 -0000 Received: (qmail 26763 invoked by uid 500); 30 Nov 2010 14:58:40 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 24885 invoked by uid 500); 30 Nov 2010 14:58:36 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 24783 invoked by uid 99); 30 Nov 2010 14:58:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Nov 2010 14:58:28 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of covener@gmail.com designates 74.125.82.43 as permitted sender) Received: from [74.125.82.43] (HELO mail-ww0-f43.google.com) (74.125.82.43) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Nov 2010 14:58:23 +0000 Received: by wwi17 with SMTP id 17so348098wwi.12 for ; Tue, 30 Nov 2010 06:58:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=+7T5/OteWCOTnH1UsUNeZtWWPxM+ev8dugpIlFJ3o0E=; b=gx0gemw9euCPi0EizDe5CSZRfsbUeZp9WoxKRvUxVVfecSMyT9RrvMHD/FoTxmK7xh sDIOyyYRLNSitJ+aHoNSLq4OnNM/Y46At1Q+cOuUezTR/yp8tmZgfxLhSdLKPZOTOJfF 6b8WMAvIGd4OVAHxn0wbHGKAyB4n3k7TaxIJs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=iKN1TYP7TMEJVdcvoVcMyUjaf9K3VitqjPdH5bG6ahMIauzeYQFqZRzrJCssugMDKs CRWSApDjJ6YumH4lxnfL7D1D/iYtzdpFRsT2NIvae8bR0JbopogyNBUu+F/McibtLfaE 4ZwoEojm6Us8USrTaTRDZXTpRttn4S+P6aFp8= MIME-Version: 1.0 Received: by 10.227.129.80 with SMTP id n16mr7812105wbs.43.1291129081946; Tue, 30 Nov 2010 06:58:01 -0800 (PST) Received: by 10.216.1.71 with HTTP; Tue, 30 Nov 2010 06:58:01 -0800 (PST) In-Reply-To: References: <39eebf.b59e.12c9cabef3f.Coremail.whut_jia@163.com> <8d4690.bc44.12c9d0ad7ea.Coremail.whut_jia@163.com> Date: Tue, 30 Nov 2010 09:58:01 -0500 Message-ID: Subject: Re: Re: compile a file written by C++ into apache From: Eric Covener To: modules-dev@httpd.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Nov 30, 2010 at 8:58 AM, Ben Noordhuis wrote: > 2010/11/30 whut_jia : >> In Apache2.2, I compile a c++ source file with g++ as below=EF=BC=9A >> g++ -fPIC -shared -o mod_validate.so mod_validate.cpp -I/usr/include/htt= pd -I/usr/include/apr-1 -I/opt/opensaml/include >> After it , I copy mod_calidate.so into apache module location ,and this = module work well. >> But now,in apache2.3,I compile this file in =C2=A0the same way.it accurs= the following error, >> =C2=A0 =C2=A0 /apache2.3/include/http_config.h:989:error:expected ","or = "..." before =E2=80=98new=E2=80=99 >> (In headers file ,The 989th =C2=A0line is: >> AP_DECLARE(void) ap_merge_log_config(const struct ap_logconf *old, >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct ap_logconf *= new); >> ) >> I think there are not errors in this line ,but why can i compile it succ= essfullly? > > new is a C++ keyword. Three solutions. > > 1. Rename the parameter in http_config.h to new_conf. Bad. > 2. At the top of your source file add "#define new new_". Bad. > 3. Make your module C only. Split off the C++ code into a separate file. = Good. > I believe this was reported and fixed in trunk over the last month or so. --=20 Eric Covener covener@gmail.com