Skip site navigation (1) Skip section navigation (2)

Re: [INTERFACES] PL_na undeclared

From: Brian P Millett <bpm(at)ec-group(dot)com>
To: John Cusick <jcusick(at)exotrope(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-interfaces(at)hub(dot)org, Doug MacEachern <dougm(at)perl(dot)apache(dot)org>
Subject: Re: [INTERFACES] PL_na undeclared
Date: 1999-09-30 21:56:38
Message-ID: 37F3DC96.CA874DF5@ec-group.com (view raw or flat)
Thread:
Lists: pgsql-interfaces
John Cusick wrote:

> On Mon, 27 Sep 1999, Tom Lane wrote:
> >
> > John Cusick <jcusick(at)exotrope(dot)net> writes:
> > > I patched the 6.5.1 source yesterday to 6.5.2 and when making the perl
> > > interface I get the following error:
> > > 'PL_na' undeclared (first use this function)
> > > throughout the make process.
> >
> > We've heard reports of that before.  Apparently, the low-level
> > interfaces to Perl have changed incompatibly in the recent past
> > (between 5.004 something and 5.005 something I think).
> >
> > We have been looking for a Perl guru who knows how to make Pg.pm
> > work under both older and newer Perls --- breaking back revs to
> > work with the latest doesn't seem particularly appealing :-(
> >
> > Know any Perl gurus?
>
> Unfortunately, no.  Most people in my hometown never heard of it.
>
> > > My system is a Redhat5.1 based running 2.2.10 with updated glibc as well
> > > as perl 5.004.04.
> >
> > Are you sure it's not 5.005 something?  5.004_04 is what I'm using here,
> > and it seems perfectly happy with the current Pg.pm.  The folks who
> > reported this error before were using bleeding-edge Perls...
> >
> >                       regards, tom lane
> >
> Tom, et. al.
>
> Yes, I'm sure I'm using perl5.004.04 (Redhat perl-5.004m4-1.rpm distro)
> This was an update on the Redhat site.
>
> I have searched through all the header files on my system that are
> declared in pg.c and there is no reference to PL_na in any of them.
> I also searched through the original 5.004.04 that came with Redhat5.1 and
> it isn't declared in any of the perl files there either.
>
> Does anyone know where PL_na is declared (and, out curiousity, what it
> is)?

In http://www.perl.com/pub/doc/manual/html/pod/perlguts.html:

PL_na
      A variable which may be used with SvPV to tell Perl to calculate the
string length.

I was looking at how Doug MacEachern handles all of the new perl global
variables in modperl.  In the Makefile.PL file, there is a subroutine
"write_version_h" that writes a .h file that defines a variable that is the
perl version.  IE:

#define PERLV 500503

Then when the src is being compiled, it loads the .h file:

#ifndef MOD_PERL_STRING_VERSION
#include "mod_perl_version.h"
#endif
#ifndef MOD_PERL_VERSION
#define MOD_PERL_VERSION "TRUE"
#endif

/* patchlevel.h causes a -Wall warning,
 * plus chance that another patchlevel.h might be in -I paths
 * so try to avoid it if possible
 */
#ifdef PERLV
#if PERLV >= 500476
#include "perl_PL.h"
#endif
#else
#include "patchlevel.h"
#if ((PATCHLEVEL >= 4) && (SUBVERSION >= 76)) || (PATCHLEVEL >= 5)
#include "perl_PL.h"
#endif
#endif /*PERLV*/

So if the PERLV is greater than 5.004_76 (When all of the internals started to
be renamed) then the file perl_PL.h is included.  The perl_PL.h is:

---BEGIN---
#ifndef patchlevel
#define patchlevel PL_patchlevel
#endif
#ifndef maxo
#define maxo PL_maxo
#endif
#ifndef op_mask
#define op_mask PL_op_mask
#endif
#ifndef op_name
#define op_name PL_op_name
#endif
#ifndef op_desc
#define op_desc PL_op_desc
#endif
#ifndef statcache
#define statcache PL_statcache
#endif
#ifndef laststatval
#define laststatval PL_laststatval
#endif
#ifndef rs
#define rs PL_rs
#endif
#ifndef beginav
#define beginav PL_beginav
#endif
#ifndef defoutgv
#define defoutgv PL_defoutgv
#endif
#ifndef defstash
#define defstash PL_defstash
#endif
#ifndef egid
#define egid PL_egid
#endif
#ifndef endav
#define endav PL_endav
#endif
#ifndef envgv
#define envgv PL_envgv
#endif
#ifndef euid
#define euid PL_euid
#endif
#ifndef gid
#define gid PL_gid
#endif
#ifndef hints
#define hints PL_hints
#endif
#ifndef incgv
#define incgv PL_incgv
#endif
#ifndef pidstatus
#define pidstatus PL_pidstatus
#endif
#ifndef scopestack_ix
#define scopestack_ix PL_scopestack_ix
#endif
#ifndef siggv
#define siggv PL_siggv
#endif
#ifndef uid
#define uid PL_uid
#endif
#ifndef warnhook
#define warnhook PL_warnhook
#endif
#ifndef diehook
#define diehook PL_diehook
#endif
#ifndef perl_destruct_level
#define perl_destruct_level PL_perl_destruct_level
#endif
#ifndef sv_count
#define sv_count PL_sv_count
#endif
#ifndef sv_objcount
#define sv_objcount PL_sv_objcount
#endif

#ifndef sv_undef
#define sv_undef PL_sv_undef
#endif
#ifndef sv_yes
#define sv_yes PL_sv_yes
#endif
#ifndef sv_no
#define sv_no PL_sv_no
#endif
#ifndef na
#define na PL_na
#endif
#ifndef curcop
#define curcop PL_curcop
#endif
#ifndef curstash
#define curstash PL_curstash
#endif
#ifndef dowarn
#define dowarn PL_dowarn
#endif
#ifndef tainting
#define tainting PL_tainting
#endif
#ifndef stack_sp
#define stack_sp PL_stack_sp
#endif
---END---

--
Brian Millett
Enterprise Consulting Group     "Heaven can not exist,
(314) 205-9030                     If the family is not eternal"
bpm(at)ec-group(dot)com                   F. Ballard Washburn




In response to

pgsql-interfaces by date

Next:From: Tom LaneDate: 1999-09-30 23:12:11
Subject: Re: [INTERFACES] PL_na undeclared
Previous:From: Dana L. HonesDate: 1999-09-30 21:53:34
Subject: ECPG and Table/Field name case sensitivity

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group