Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41680 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98654 invoked from network); 5 Nov 2008 09:15:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Nov 2008 09:15:27 -0000 Received: from [127.0.0.1] ([127.0.0.1:2974]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id FB/A7-50953-F2461194 for ; Wed, 05 Nov 2008 04:15:27 -0500 Authentication-Results: pb1.pair.com smtp.mail=zhangsilly@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=zhangsilly@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.200.173 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: zhangsilly@gmail.com X-Host-Fingerprint: 209.85.200.173 wf-out-1314.google.com Received: from [209.85.200.173] ([209.85.200.173:30222] helo=wf-out-1314.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 73/17-50953-55261194 for ; Wed, 05 Nov 2008 04:07:35 -0500 Received: by wf-out-1314.google.com with SMTP id 26so3867096wfd.26 for ; Wed, 05 Nov 2008 01:07:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=SYA1cT8sYOTmV+DniVYQpNtC422LIrVrA71TtZNTLcY=; b=C1/VKrjEa14jeFX8Z9KqWofnaLCxicZrcYrlR2OWp+hEGGYtaIUh5E/oH4++L66ARi Unh4pQA5z8jpc+9qu5UkgfsTizlJkNrMeMPXmFTXFiOmOkTgIbxNjgbvm6AibjFXAdQR t4CPO1LQ/Jvn9gHXAikX3oqPmNZwZuSA0m+BA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=gOdR6r2WPQrv3TStuzO0CdANW6qh3W+8iwcamK/BjYEc2NsO1WfB6a14uG46CdwCWM j4gd+W36LS1YIqftRmpnec3tLDPhRdDi5k97VRSRBJrL/0SpyB0qOxxSb/OkGvcjvSql /a6pviDKkj8soLo1lVcMCdqqwD7GeM4ZAGy4w= Received: by 10.142.177.7 with SMTP id z7mr315917wfe.249.1225876051154; Wed, 05 Nov 2008 01:07:31 -0800 (PST) Received: by 10.142.125.7 with HTTP; Wed, 5 Nov 2008 01:07:31 -0800 (PST) Message-ID: Date: Wed, 5 Nov 2008 17:07:31 +0800 To: internals@lists.php.net MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2165_10315591.1225876051150" Subject: why these code cause compile error? From: zhangsilly@gmail.com ("=?GB2312?B?1cXQxMHp?=") ------=_Part_2165_10315591.1225876051150 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I 'am a new guy of php internal, I tried to define a class in extension just for a attempt. PHP_MINIT_FUNCTION(zhangjianyu) { /* If you have INI entries, uncomment these lines REGISTER_INI_ENTRIES(); */ zend_class_entry ce; INIT_CLASS_ENTRY(ce, WPS_CLASS_NAME, php_wps_method_functions); php_wps_sc_entry = zend_register_internal_class(&ce TSRMLS_CC); zend_declare_class_constant_double(php_wps_sc_entry, "VERSION", sizeof("VERSION"), 1.32 TSRMLS_DC); zend_declare_class_constant_string(php_wps_sc_entry, "NAME", sizeof("NAME"), "say say" TSRMLS_DC); return SUCCESS; } The Code above will cause compile errors like this: error C2059: syntax error : 'type', just indicate the line zend_declare_class_constant_double(php_wps_sc_entry, "VERSION", sizeof("VERSION"), 1.32 TSRMLS_DC); is not correct. Either I use zend_declare_class_constant_double or usezend_declare_property_null(php_wps_sc_entry, "name", strlen("name"), ZEND_ACC_PUBLIC TSRMLS_DC),both of them will cause the same error : error C2059: syntax error : 'type' ------=_Part_2165_10315591.1225876051150--