Mercurial > hg > orthanc
diff Resources/GenerateErrorCodes.py @ 1580:bf502300c52e
force the size of the enumerations in the plugin SDK
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 25 Aug 2015 15:59:07 +0200 |
parents | 09715095fc53 |
children | bd1889029cbb |
line wrap: on
line diff
--- a/Resources/GenerateErrorCodes.py Tue Aug 25 15:45:50 2015 +0200 +++ b/Resources/GenerateErrorCodes.py Tue Aug 25 15:59:07 2015 +0200 @@ -79,7 +79,8 @@ a = f.read() s = ',\n'.join(map(lambda x: ' OrthancPluginErrorCode_%s = %d /*!< %s */' % (x['Name'], int(x['Code']), x['Description']), ERRORS)) -a = re.sub('(typedef enum\s*{)[^}]*?(\s*} OrthancPluginErrorCode;)', r'\1\n%s\2' % s, a, re.DOTALL) +s += ',\n\n _OrthancPluginErrorCode_INTERNAL = 0x7fffffff\n ' +a = re.sub('(typedef enum\s*{)[^}]*?(} OrthancPluginErrorCode;)', r'\1\n%s\2' % s, a, re.DOTALL) with open(path, 'w') as f: f.write(a)