Skip to content

Commit 6bf2be3

Browse files
committed
Included Python.h first to fix compilation.
1 parent 6b82fa3 commit 6bf2be3

File tree

8 files changed

+19
-0
lines changed

8 files changed

+19
-0
lines changed

src/ngx_http_python_module.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66

7+
#include <Python.h>
78
#include <ngx_config.h>
89
#include <ngx_core.h>
910
#include <ngx_http.h>

src/ngx_http_python_request.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66

7+
#include <Python.h>
78
#include <ngx_config.h>
89
#include <ngx_core.h>
910
#include <ngx_http.h>

src/ngx_python.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@
44
*/
55

66

7+
#include <Python.h>
8+
9+
/*
10+
* The Python.h file is included first in contrast with normal nginx
11+
* practice. Python headers deliberately define the following macros:
12+
* _GNU_SOURCE, _POSIX_C_SOURCE, _XOPEN_SOURCE.
13+
* When compiling on Linux, they are defined by nginx or system headers
14+
* with Python possibly redefining them. Since nginx is built with
15+
* -Werror compilation option, macros redefinition causes compilation
16+
* errors on some Linux systems.
17+
*/
18+
719
#include <ngx_config.h>
820
#include <ngx_core.h>
921
#include <ngx_event_posted.h>

src/ngx_python_resolve.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66

7+
#include <Python.h>
78
#include <ngx_config.h>
89
#include <ngx_core.h>
910
#include <ngx_event_connect.h>

src/ngx_python_sleep.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66

7+
#include <Python.h>
78
#include <ngx_config.h>
89
#include <ngx_core.h>
910
#include <ngx_event.h>

src/ngx_python_socket.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66

7+
#include <Python.h>
78
#include <ngx_config.h>
89
#include <ngx_core.h>
910
#include <ngx_event_connect.h>

src/ngx_stream_python_module.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66

7+
#include <Python.h>
78
#include <ngx_config.h>
89
#include <ngx_core.h>
910
#include <ngx_stream.h>

src/ngx_stream_python_session.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66

7+
#include <Python.h>
78
#include <ngx_config.h>
89
#include <ngx_core.h>
910
#include <ngx_stream.h>

0 commit comments

Comments
 (0)