mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-20 05:17:00 +08:00
Like commit 388e80132, use "#pragma GCC system_header" to silence warnings appearing within the Python headers, since newer Python versions no longer worry about some restrictions we still use like -Wdeclaration-after-statement. This patch improves on 388e80132 by inventing a separate wrapper header file, allowing the pragma to be tightly scoped to just the Python headers and not other stuff we have laying about in plpython.h. I applied the same technique to plperl for the same reason: the original patch suppressed warnings for a good deal of our own code, not only the Perl headers. Like the previous commit, back-patch to supported branches. Peter Eisentraut and Tom Lane Discussion: https://postgr.es/m/ae523163-6d2a-4b81-a875-832e48dec502@eisentraut.org
41 lines
1.1 KiB
C
41 lines
1.1 KiB
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* plpython.h - Python as a procedural language for PostgreSQL
|
|
*
|
|
* Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
*
|
|
* src/pl/plpython/plpython.h
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#ifndef PLPYTHON_H
|
|
#define PLPYTHON_H
|
|
|
|
/*
|
|
* Include order should be: postgres.h, other postgres headers, plpython.h,
|
|
* other plpython headers. (In practice, other plpython headers will also
|
|
* include this file, so that they can compile standalone.)
|
|
*/
|
|
#ifndef POSTGRES_H
|
|
#error postgres.h must be included before plpython.h
|
|
#endif
|
|
|
|
/*
|
|
* Pull in Python headers via a wrapper header, to control the scope of
|
|
* the system_header pragma therein.
|
|
*/
|
|
#include "plpython_system.h"
|
|
|
|
/* define our text domain for translations */
|
|
#undef TEXTDOMAIN
|
|
#define TEXTDOMAIN PG_TEXTDOMAIN("plpython")
|
|
|
|
/*
|
|
* Used throughout, and also by the Python 2/3 porting layer, so it's easier to
|
|
* just include it everywhere.
|
|
*/
|
|
#include "plpy_util.h"
|
|
|
|
#endif /* PLPYTHON_H */
|