From 0a5703458b7f577f628ca123a47c209653f19dc2 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Sun, 8 Dec 2019 14:46:48 -0800 Subject: [lldb/SWIG] Guard embedded Python code in SWIG interfaces by SWIGPYTHON Guard the embedded Python code in LLDB's interface files by the SWIGPYTHON define to ensures they can be reused for other languages supported by SWIG. --- lldb/scripts/interface/SBModule.i | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lldb/scripts/interface/SBModule.i') diff --git a/lldb/scripts/interface/SBModule.i b/lldb/scripts/interface/SBModule.i index 06a4628d52b..03c8aeb2bed 100644 --- a/lldb/scripts/interface/SBModule.i +++ b/lldb/scripts/interface/SBModule.i @@ -8,6 +8,7 @@ namespace lldb { +#ifdef SWIGPYTHON %pythoncode%{ # ================================== # Helper function for SBModule class @@ -30,6 +31,7 @@ def in_range(symbol, section): else: return False %} +#endif %feature("docstring", "Represents an executable image and its associated object and symbol files. @@ -342,6 +344,7 @@ public: lldb::SBAddress GetObjectFileEntryPointAddress() const; +#ifdef SWIGPYTHON %pythoncode %{ def __len__(self): '''Return the number of symbols in a lldb.SBModule object.''' @@ -542,6 +545,7 @@ public: num_sections = property(GetNumSections, None, doc='''A read only property that returns number of sections in the module as an integer.''') %} +#endif }; -- cgit v1.2.3