Received: (qmail 15567 invoked by uid 2012); 12 Jan 1998 01:39:03 -0000 Message-Id: <19980112013903.15566.qmail@hyperreal.org> Date: 12 Jan 1998 01:39:03 -0000 From: Ron O'Hara Reply-To: rono@sentuny.com.au To: apbugs@hyperreal.org Subject: Conflict of routine 'palloc' name/parameters with other software (PostgreSQL) X-Send-Pr-Version: 3.2 >Number: 1652 >Category: apache-api >Synopsis: Conflict of routine 'palloc' name/parameters with other software (PostgreSQL) >Confidential: no >Severity: critical >Priority: medium >Responsible: apache >State: closed >Class: change-request >Submitter-Id: apache >Arrival-Date: Sun Jan 11 17:40:01 PST 1998 >Last-Modified: Fri Mar 20 02:02:30 PST 1998 >Originator: rono@sentuny.com.au >Organization: >Release: 1.3 >Environment: Linux 2.0.33, gcc etc - Not Relevant to problem >Description: I'm writing a user module for apache that is using the PostgreSQL 6.2.1 C client api. This API has a routine called 'palloc'. The Apache server has it's own routine called 'palloc'. The routines have different parameters. The name conflict needs to be removed - I have submitted a Bug report to the postgres team, and will modify the Apache code as a workaround, but the same problem could easily occur with Apache routines which use common names and other ill behaved product API's (Oracle ?). >How-To-Repeat: Add the Postgres #include 'libpq-fe.h' to the start of 'mod_usertrack'. >Fix: --- partial solution to namespace conflicts (common routines only) --- Change the internal name of Apache's palloc routine to 'ap_palloc' [a very non-standard name] and change 'alloc.h' to #define palloc to refer to the 'ap_palloc' routine if USE_AP_PALLOC is not defined. IE. #ifndef USE_AP_PALLOC #define palloc(a,b) ap_alloc(a,b) #endif (The same is needed for 'pcalloc', 'pstrdup', 'pstrndup' and 'pstrcat') Impact of change is reduced to the 'alloc.c' and 'alloc.h' routines (plus any naughty routines that dont have a #include 'alloc.h' but still use 'palloc') This allows a developer of a user module to utilise other tools which want to supply their own 'palloc' routine and still have access to the core Apache routines via their real internal names. %0 >Audit-Trail: State-Changed-From-To: open-closed State-Changed-By: rse State-Changed-When: Fri Mar 20 02:02:30 PST 1998 State-Changed-Why: This now solved be the new HIDE Rule (see Configuration.tmpl in 1.3b6-dev) which hides the complete symbol namespace of Apache and thus avoids those conflicts. Then just make sure `Rule HIDE=yes' is set (which currently is the default in 1.3b6-dev) when you compile with PostgreSQL. >Unformatted: [In order for any reply to be added to the PR database, ] [you need to include in the Cc line ] [and leave the subject line UNCHANGED. This is not done] [automatically because of the potential for mail loops. ]