PostgreSQL Source Code
git master
Loading...
Searching...
No Matches
plpython_system.h
Go to the documentation of this file.
1
/*-------------------------------------------------------------------------
2
*
3
* plpython_system.h - pull in Python's system header files
4
*
5
* We break this out as a separate header file to precisely control
6
* the scope of the "system_header" pragma. No Postgres-specific
7
* declarations should be put here. However, we do include some stuff
8
* that is meant to prevent conflicts between our code and Python.
9
*
10
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
11
* Portions Copyright (c) 1994, Regents of the University of California
12
*
13
* src/pl/plpython/plpython_system.h
14
*
15
*-------------------------------------------------------------------------
16
*/
17
#ifndef PLPYTHON_SYSTEM_H
18
#define PLPYTHON_SYSTEM_H
19
20
/*
21
* Newer versions of the Python headers trigger a lot of warnings with our
22
* preferred compiler flags (at least -Wdeclaration-after-statement is known
23
* to be problematic). The system_header pragma hides warnings from within
24
* the rest of this file, if supported.
25
*/
26
#ifdef HAVE_PRAGMA_GCC_SYSTEM_HEADER
27
#pragma GCC system_header
28
#endif
29
30
/*
31
* Python versions <= 3.8 otherwise define a replacement, causing macro
32
* redefinition warnings.
33
*/
34
#define HAVE_SNPRINTF 1
35
36
#if defined(_MSC_VER) && defined(_DEBUG)
37
/*
38
* Python uses #pragma to bring in a non-default libpython on VC++ if
39
* _DEBUG is defined
40
*/
41
#undef _DEBUG
42
/* Also hide away errcode, since we load Python.h before postgres.h */
43
#define errcode __msvc_errcode
44
#include <Python.h>
45
#undef errcode
46
#define _DEBUG
47
#elif defined (_MSC_VER)
48
#define errcode __msvc_errcode
49
#include <Python.h>
50
#undef errcode
51
#else
52
#include <Python.h>
53
#endif
54
55
#endif
/* PLPYTHON_SYSTEM_H */
src
pl
plpython
plpython_system.h
Generated on Thu May 21 2026 16:13:17 for PostgreSQL Source Code by
1.9.8