diff --git a/wrappers/cpp/abstractapi.py b/wrappers/cpp/abstractapi.py index 8214fd8c3..f5189e24c 100644 --- a/wrappers/cpp/abstractapi.py +++ b/wrappers/cpp/abstractapi.py @@ -20,7 +20,7 @@ import genapixml as CApi class Error(RuntimeError): pass -class BlacklistedException: +class BlacklistedException(Error): pass class Name(object): @@ -193,6 +193,7 @@ class Object(object): def __init__(self, name): self.name = name self.parent = None + self.deprecated = False def find_first_ancestor_by_type(self, _type): ancestor = self.parent @@ -731,6 +732,7 @@ class CParser(object): raise BlacklistedException('{0} is blacklisted'.format(name.to_c())); method = Method(name, type=type) + method.deprecated = cfunction.deprecated method.returnType = CParser.parse_type(self, cfunction.returnArgument) for arg in cfunction.arguments: diff --git a/wrappers/cpp/class_header.mustache b/wrappers/cpp/class_header.mustache index 61b458ce7..0e958924b 100644 --- a/wrappers/cpp/class_header.mustache +++ b/wrappers/cpp/class_header.mustache @@ -58,21 +58,21 @@ namespace linphone { {{/isNotListener}} {{#ismonolistenable}} - void setListener(const std::shared_ptr<{{{listenerClassName}}}> &listener); + LINPHONE_PUBLIC void setListener(const std::shared_ptr<{{{listenerClassName}}}> &listener); {{/ismonolistenable}} {{#ismultilistenable}} - void addListener(std::shared_ptr<{{{listenerClassName}}}> &listener); - void removeListener(std::shared_ptr<{{{listenerClassName}}}> &listener); + LINPHONE_PUBLIC void addListener(std::shared_ptr<{{{listenerClassName}}}> &listener); + LINPHONE_PUBLIC void removeListener(std::shared_ptr<{{{listenerClassName}}}> &listener); {{/ismultilistenable}} public: {{#isfactory}} - std::shared_ptr createCore(const std::shared_ptr & cbs, const std::string & configPath, const std::string & factoryConfigPath) const; - std::shared_ptr createCoreWithConfig(const std::shared_ptr & cbs, const std::shared_ptr & config) const; + LINPHONE_PUBLIC std::shared_ptr createCore(const std::shared_ptr & cbs, const std::string & configPath, const std::string & factoryConfigPath) const; + LINPHONE_PUBLIC std::shared_ptr createCoreWithConfig(const std::shared_ptr & cbs, const std::shared_ptr & config) const; {{/isfactory}} {{#isVcard}} - std::shared_ptr &getVcard(); + LINPHONE_PUBLIC std::shared_ptr &getVcard(); {{/isVcard}} {{#methods}} diff --git a/wrappers/cpp/genheaders.py b/wrappers/cpp/genheaders.py index 113f2de63..be1336575 100755 --- a/wrappers/cpp/genheaders.py +++ b/wrappers/cpp/genheaders.py @@ -212,8 +212,10 @@ class CppTranslator(object): else: methodElems['methodType'] = '' + methodElems['deprecated'] = 'LINPHONE_DEPRECATED ' if method.deprecated else '' + methodDict = {} - methodDict['prototype'] = '{methodType}{return} {name}({params}){const}{semicolon}'.format(**methodElems) + methodDict['prototype'] = 'LINPHONE_PUBLIC {deprecated}{methodType}{return} {name}({params}){const}{semicolon}'.format(**methodElems) if genImpl: if not CppTranslator.is_ambigous_type(self, method.returnType):