Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22342 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78696 invoked by uid 1010); 11 Mar 2006 23:11:26 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 78681 invoked from network); 11 Mar 2006 23:11:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Mar 2006 23:11:26 -0000 X-Host-Fingerprint: 194.73.73.210 c2bthomr02.btconnect.com FreeBSD 4.7-5.2 (or MacOS X 10.2-10.3) (2) Received: from ([194.73.73.210:16944] helo=c2bthomr02.btconnect.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id A4/0A-21161-D1953144 for ; Sat, 11 Mar 2006 18:11:25 -0500 Received: from va517slx (host81-134-174-53.in-addr.btopenworld.com [81.134.174.53]) by c2bthomr02.btconnect.com (MOS 3.5.9-GR) with ESMTP id DWV02651; Sat, 11 Mar 2006 23:10:34 GMT To: internals@lists.php.net Date: Sat, 11 Mar 2006 23:11:19 +0000 User-Agent: KMail/1.8 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <200603112311.19732.an.dromeda@btconnect.com> Subject: Separating C++ zend object creation code from module code From: an.dromeda@btconnect.com ("Andrew Mather (BT Std)") Hi there, I've successfully developed a stripped down C++ php class creator, with private storage, a la Marcus Boerger util.c, and following Jay Smith, George Schlossnagle et al. For neater code, I've stripped out function declarations, function entry tables, class entry etc. into a second .h/.cpp file pair, until all that's left are the static style functions, eg: static void some_object_free_storage(void *object TSRMLS_DC); and static zend_object_value some_object_new_ex(zend_class_entry *class_type, some_object **obj TSRMLS_DC); The nuance of cross-referencing these calls between two .cpp files (listed in config.m4, and so compiled into distinct .o files), eludes me. It's a c/cpp grammar issue, I guess, but one I've never had to deal with till now. Originally I had static foo1() calling static foo2() both in file1.cpp. Now I have static foo1() in file1.cpp calling (static?) foo2() in file2.cpp The correct syntax eludes me I'm afraid, and various static/non-static/extern combinations result either in 'used but not defined' errors, or compile fine but symbol not found, or sigsegv faults, presumably as the 'promised' function is unavailable. (latter output below) Perhaps someone would be kind enough to clarify the syntax appropriate for this call between modules/.o files. Cheers, Andrew.