Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [committed] Wrap python_write_bytecode with HAVE_PYTHON ifdef
@ 2022-07-21  0:13 Kevin Buettner via Gdb-patches
  0 siblings, 0 replies; only message in thread
From: Kevin Buettner via Gdb-patches @ 2022-07-21  0:13 UTC (permalink / raw)
  To: gdb-patches

This commit fixes a build error on machines lacking python headers
and/or libraries.
---
 gdb/python/python.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gdb/python/python.c b/gdb/python/python.c
index 2b85bbb6301..01b5145c2a4 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -1855,6 +1855,7 @@ show_python_dont_write_bytecode (struct ui_file *file, int from_tty,
 		value);
 }
 
+#ifdef HAVE_PYTHON
 /* Return value to assign to PyConfig.write_bytecode or, when
    negated (via !), Py_DontWriteBytecodeFlag.  Py_DontWriteBytecodeFlag
    is deprecated in Python 3.12.  */
@@ -1879,6 +1880,7 @@ python_write_bytecode ()
 
   return wbc;
 }
+#endif /* HAVE_PYTHON */
 
 /* Implement 'set python dont-write-bytecode'.  This sets Python's internal
    flag no matter when the command is issued, however, if this is used
-- 
2.36.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-21  0:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-21  0:13 [committed] Wrap python_write_bytecode with HAVE_PYTHON ifdef Kevin Buettner via Gdb-patches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox