• Tom Lane's avatar
    Prevent Perl from introducing a possibly-incompatible definition of type · f608f3b8
    Tom Lane authored
    "bool" into plperl.c.  This has always been a hazard since Perl allows a
    platform-specific choice to define bool as int rather than char, but
    evidently this didn't happen on any platform we support ... until OS X 10.5.
    Per report from Brandon Maust.
    
    Back-patch as far as 8.0 --- a bit arbitrary, but it seems unlikely anyone
    will be trying to port 7.x onto new platforms.
    f608f3b8
plperl.h 1.63 KB
/*-------------------------------------------------------------------------
 *
 * plperl.h
 *	  Common include file for PL/Perl files
 *
 * This should be included _AFTER_ postgres.h and system include files
 *
 * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
 * Portions Copyright (c) 1995, Regents of the University of California
 *
 * $PostgreSQL: pgsql/src/pl/plperl/plperl.h,v 1.7 2007/11/22 17:47:28 tgl Exp $
 */

#ifndef PL_PERL_H
#define PL_PERL_H

/* stop perl headers from hijacking stdio and other stuff on Windows */
#ifdef WIN32
#define WIN32IO_IS_STDIO
/*
 * isnan is defined in both the perl and mingw headers. We don't use it,
 * so this just clears up the compile warning.
 */
#ifdef isnan
#undef isnan
#endif
#endif

/* required for perl API */
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"

/* just in case these symbols aren't provided */
#ifndef pTHX_
#define pTHX_
#define pTHX void
#endif

/* perl may have a different width of "bool", don't buy it */
#ifdef bool
#undef bool
#endif

/* routines from spi_internal.c */
int			spi_DEBUG(void);
int			spi_LOG(void);
int			spi_INFO(void);
int			spi_NOTICE(void);
int			spi_WARNING(void);
int			spi_ERROR(void);

/* routines from plperl.c */
HV		   *plperl_spi_exec(char *, int);
void		plperl_return_next(SV *);
SV		   *plperl_spi_query(char *);
SV		   *plperl_spi_fetchrow(char *);
SV		   *plperl_spi_prepare(char *, int, SV **);
HV		   *plperl_spi_exec_prepared(char *, HV *, int, SV **);
SV		   *plperl_spi_query_prepared(char *, int, SV **);
void		plperl_spi_freeplan(char *);
void		plperl_spi_cursor_close(char *);



#endif   /* PL_PERL_H */