Skip to content

Commit

Permalink
build: Fix compile warning message
Browse files Browse the repository at this point in the history
I solved the problem by simply undefing _XOPEN_SOURCE.
I defined PY_SSIZE_T_CLEAN.
It needs to be defined before including Python.h

Fixed: #1648

Signed-off-by: Jin Jang <keepgoingxxx@gmail.com>
  • Loading branch information
keepgoingxxx authored and namhyung committed Nov 3, 2023
1 parent c320412 commit 03c953e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/trace-python.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
*
* Released under the GPL v2.
*/

#undef _XOPEN_SOURCE
#define PY_SSIZE_T_CLEAN
#include <Python.h>

#include <fcntl.h>
Expand Down
1 change: 1 addition & 0 deletions utils/script-python.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ struct script_info;

#if defined(HAVE_LIBPYTHON2) || defined(HAVE_LIBPYTHON3)

#define PY_SSIZE_T_CLEAN
#include <Python.h>

#define SCRIPT_PYTHON_ENABLED 1
Expand Down

0 comments on commit 03c953e

Please sign in to comment.