From: Daniel Elstner Date: Mon, 26 Oct 2015 04:18:06 +0000 (+0100) Subject: C++: Use C++98 syntax for default arguments to appease SWIG X-Git-Tag: libsigrok-0.4.0~166 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=bf03d63565f60d758f53ecde0b30631463e44609;p=libsigrok.git C++: Use C++98 syntax for default arguments to appease SWIG Looks like SWIG silently ignores default arguments specified via aggregate initialization. This is rather unfortunate, especially if the argument types are complex. --- diff --git a/bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp b/bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp index a74bbfcf..f7b2c468 100644 --- a/bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp +++ b/bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp @@ -352,8 +352,8 @@ public: string long_name() const; /** Scan for devices and return a list of devices found. * @param options Mapping of (ConfigKey, value) pairs. */ - vector > scan( - const map &options = {}); + vector > scan(const map + &options = map()); private: struct sr_dev_driver *_structure; bool _initialized; @@ -798,7 +798,8 @@ public: map > options(); /** Create an input using this input format. * @param options Mapping of (option name, value) pairs. */ - shared_ptr create_input(const map &options = {}); + shared_ptr create_input(const map + &options = map()); private: explicit InputFormat(const struct sr_input_module *structure); ~InputFormat(); @@ -891,16 +892,15 @@ public: /** Create an output using this format. * @param device Device to output for. * @param options Mapping of (option name, value) pairs. */ - shared_ptr create_output( - shared_ptr device, - const map &options = {}); + shared_ptr create_output(shared_ptr device, + const map &options = map()); /** Create an output using this format. * @param filename Name of destination file. * @param device Device to output for. * @param options Mapping of (option name, value) pairs. */ shared_ptr create_output(string filename, shared_ptr device, - const map &options = {}); + const map &options = map()); /** * Checks whether a given flag is set. * @param flag Flag to check