Commit 9bb76d0b authored by Andrew Dunstan's avatar Andrew Dunstan

Rationalise perl header inclusions via a common include file, which also
declares routines in plperl.c and spi_internal.c used in other files.

Along the way, also stop perl from hijacking stdio and other stuff on Windows.
parent 2645cb54
...@@ -4,12 +4,7 @@ ...@@ -4,12 +4,7 @@
#undef _ #undef _
/* perl stuff */ /* perl stuff */
#include "EXTERN.h" #include "plperl.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"
#include "spi_internal.h"
/* /*
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
* ENHANCEMENTS, OR MODIFICATIONS. * ENHANCEMENTS, OR MODIFICATIONS.
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.98 2005/12/29 14:28:31 adunstan Exp $ * $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.99 2006/01/08 22:27:52 adunstan Exp $
* *
**********************************************************************/ **********************************************************************/
...@@ -60,18 +60,7 @@ ...@@ -60,18 +60,7 @@
extern DLLIMPORT bool check_function_bodies; extern DLLIMPORT bool check_function_bodies;
/* perl stuff */ /* perl stuff */
#include "EXTERN.h" #include "plperl.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"
#include "spi_internal.h"
/* just in case these symbols aren't provided */
#ifndef pTHX_
#define pTHX_
#define pTHX void
#endif
/********************************************************************** /**********************************************************************
* The information we cache about loaded procedures * The information we cache about loaded procedures
......
/*-------------------------------------------------------------------------
*
* plperl.h
* Common include file for PL/Perl files
*
* This should be included _AFTER_ postgres.h and system include files
*
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1995, Regents of the University of California
*
* $PostgreSQL: pgsql/src/pl/plperl/plperl.h,v 1.1 2006/01/08 22:27:52 adunstan 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
#endif
/* required for perl API */
#include "EXTERN.h" #include "EXTERN.h"
#include "perl.h" #include "perl.h"
#include "XSUB.h" #include "XSUB.h"
#include "ppport.h" #include "ppport.h"
int spi_DEBUG(void); /* just in case these symbols aren't provided */
#ifndef pTHX_
#define pTHX_
#define pTHX void
#endif
/* routines from spi_internal.c */
int spi_DEBUG(void);
int spi_LOG(void); int spi_LOG(void);
int spi_INFO(void); int spi_INFO(void);
int spi_NOTICE(void); int spi_NOTICE(void);
int spi_WARNING(void); int spi_WARNING(void);
int spi_ERROR(void); int spi_ERROR(void);
/* this is actually in plperl.c */ /* routines from plperl.c */
HV *plperl_spi_exec(char *, int); HV *plperl_spi_exec(char *, int);
void plperl_return_next(SV *); void plperl_return_next(SV *);
SV *plperl_spi_query(char *); SV *plperl_spi_query(char *);
SV *plperl_spi_fetchrow(char *); SV *plperl_spi_fetchrow(char *);
#endif /* PL_PERL_H */
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
/* Defined by Perl */ /* Defined by Perl */
#undef _ #undef _
#include "spi_internal.h" /* perl stuff */
#include "plperl.h"
int int
spi_DEBUG(void) spi_DEBUG(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment