]> sigrok.org Git - libsigrok.git/commit - bindings/swig/doc.py
bindings/ruby: Fix ruby SWIG bindings generation
authorAnatol Pomozov <redacted>
Tue, 9 Jun 2020 03:46:44 +0000 (20:46 -0700)
committerUwe Hermann <redacted>
Sat, 20 Jun 2020 16:09:27 +0000 (18:09 +0200)
commit2e199405e53fee2fb3cad72858ebe7af6990bce0
tree4e85599ce78ae63c0a10f23aa8836907f718ed29
parent35be304ba63a8d65904de2fdbcd5d848c85d7671
bindings/ruby: Fix ruby SWIG bindings generation

bindings/swig/doc.py generates a swig interface file for ruby bindings
that includes docstrings with comments braces ( /* and */ ) like this:

  %feature("docstring") sigrok::Channel::type "/* Type of this channel. */\n";
  %feature("docstring") sigrok::Channel::enabled "/* Enabled status of this channel. */\n";

SWIG generates *.cxx and adds its own braces to the docstring:

/*/* Document-class: Sigrok::Error
Exception thrown when an error code is returned by any libsigrok call. */
*/

this causes compilation error for Ruby bindings.

To fix the error we should not add extra braces to the docstring.
With this patch libsigrok compiles fine with with ruby 2.7 and swig 4.0.2.

Fixes bug #1526

Signed-off-by: Anatol Pomozov <redacted>
bindings/swig/doc.py