@@ -183,28 +183,24 @@ def __init__(self):
183
183
_define_directive_re = re .compile (r'\s*#\s*define\s+(\w+)' +
184
184
r'(?:\s+|\((\w+)\)\s*)' +
185
185
r'(.+)' )
186
+ _deprecated_definition_re = re .compile ('\s*MBEDTLS_DEPRECATED' )
186
187
187
188
def read_line (self , line ):
188
189
m = re .match (self ._define_directive_re , line )
189
190
if not m :
190
191
return
191
192
name , parameter , expansion = m .groups ()
192
193
expansion = re .sub (r'/\*.*?\*/|//.*' , r' ' , expansion )
194
+ if re .match (self ._deprecated_definition_re , expansion ):
195
+ # Skip deprecated values, which are assumed to be
196
+ # backward compatibility aliases that share
197
+ # numerical values with non-deprecated values.
198
+ return
193
199
if name .endswith ('_FLAG' ) or name .endswith ('MASK' ):
194
200
# Macro only to build actual values
195
201
return
196
202
elif (name .startswith ('PSA_ERROR_' ) or name == 'PSA_SUCCESS' ) \
197
203
and not parameter :
198
- if name in [
199
- 'PSA_ERROR_UNKNOWN_ERROR' ,
200
- 'PSA_ERROR_OCCUPIED_SLOT' ,
201
- 'PSA_ERROR_EMPTY_SLOT' ,
202
- 'PSA_ERROR_INSUFFICIENT_CAPACITY' ,
203
- ]:
204
- # Ad hoc skipping of deprecated error codes, which share
205
- # numerical values with non-deprecated error codes
206
- return
207
-
208
204
self .statuses .add (name )
209
205
elif name .startswith ('PSA_KEY_TYPE_' ) and not parameter :
210
206
self .key_types .add (name )
0 commit comments