From df1642bacd1d206e65069a148b47992f736a2b33 Mon Sep 17 00:00:00 2001 From: jolavillette Date: Tue, 19 May 2026 07:57:40 +0200 Subject: [PATCH] Fix jsonapi generator and OpenSSL macro collisions --- src/jsonapi/jsonapi-generator.py | 18 ++++++++++-------- src/pqi/sslfns.h | 9 ++++++++- src/retroshare/rstor.h | 4 ++++ src/util/rsdebug.h | 4 ++++ 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/jsonapi/jsonapi-generator.py b/src/jsonapi/jsonapi-generator.py index 179546999..e8c09c568 100755 --- a/src/jsonapi/jsonapi-generator.py +++ b/src/jsonapi/jsonapi-generator.py @@ -190,15 +190,17 @@ def processFile(file): orderedParamNames.append(pName) for tmpPN in memberdef.findall('.//parametername'): - tmpParam = paramsMap[tmpPN.text] - tmpD = tmpPN.attrib['direction'] if 'direction' in tmpPN.attrib else '' + pName = getText(tmpPN) + if pName in paramsMap: + tmpParam = paramsMap[pName] + tmpD = tmpPN.attrib['direction'] if 'direction' in tmpPN.attrib else '' - if 'in' in tmpD: - tmpParam._in = True - hasInput = True - if 'out' in tmpD: - tmpParam._out = True - hasOutput = True + if 'in' in tmpD: + tmpParam._in = True + hasInput = True + if 'out' in tmpD: + tmpParam._out = True + hasOutput = True # Params sanity check for pmKey in paramsMap: diff --git a/src/pqi/sslfns.h b/src/pqi/sslfns.h index c22076c51..560d84c45 100644 --- a/src/pqi/sslfns.h +++ b/src/pqi/sslfns.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/******************************************************************************* * libretroshare/src/pqi: sslfns.h * * * * libretroshare: retroshare core library * @@ -28,6 +28,13 @@ /******************** notify of new Cert **************************/ +#ifdef X509_NAME +#undef X509_NAME +#endif +#ifdef X509_EXTENSIONS +#undef X509_EXTENSIONS +#endif + #include #include diff --git a/src/retroshare/rstor.h b/src/retroshare/rstor.h index 486c830fe..9f22dcbbb 100644 --- a/src/retroshare/rstor.h +++ b/src/retroshare/rstor.h @@ -41,6 +41,10 @@ enum class RsTorManagerEventCode: uint8_t TOR_MANAGER_STOPPED = 0x06, }; +#ifdef ERROR +#undef ERROR +#endif + // Status of the Tor hidden service setup/loaded by RS enum class RsTorHiddenServiceStatus: uint8_t { diff --git a/src/util/rsdebug.h b/src/util/rsdebug.h index 384e6eb2a..799325fce 100644 --- a/src/util/rsdebug.h +++ b/src/util/rsdebug.h @@ -38,6 +38,10 @@ #include "util/rsmacrosugar.hpp" +#ifdef ERROR +#undef ERROR +#endif + #ifdef __ANDROID__ enum class RsLoggerCategories {