add Objective C 'ATOMIC' for type-encoding 'A' modifier

This commit is contained in:
Jason P. Leasure 2020-10-30 15:57:18 -04:00
parent 8dffa0384e
commit 81a25b6c0e
2 changed files with 13 additions and 2 deletions

View file

@ -71,6 +71,7 @@ public final class ObjectiveC1_TypeEncodings {
public final static char _C_BYCOPY = 'O';
public final static char _C_BYREF = 'R';
public final static char _C_ONEWAY = 'V';
public final static char _C_ATOMIC = 'A';
private final static String ANONYMOUS_PREFIX = "Anonymous";
@ -410,8 +411,13 @@ public final class ObjectiveC1_TypeEncodings {
DataType dt = parseDataType(buffer);
return new TypedefDataType("ONEWAY " + dt.getDisplayName(), dt);
}
case _C_ATOMIC: {
buffer.deleteCharAt(0);
DataType dt = parseDataType(buffer);
return new TypedefDataType("ATOMIC " + dt.getDisplayName(), dt);
}
}
throw new UnsupportedOperationException("unrecognized format type: " + buffer.charAt(0));
throw new UnsupportedOperationException("Unsupported Objective C type encoding: " + buffer.charAt(0));
}
private Union parseBitFields(StringBuffer buffer) {

View file

@ -83,7 +83,12 @@ public class ParameterDefinitionImpl implements ParameterDefinition {
throw new IllegalArgumentException(kind +
" type must be specified with fixed-length data type: " + dataType.getName());
}
if (dataType instanceof VoidDataType) {
DataType baseType = dataType;
if(baseType instanceof TypedefDataType) {
baseType = ((TypedefDataType)baseType).getBaseDataType();
}
if (baseType instanceof VoidDataType) {
if (!isReturn) {
throw new IllegalArgumentException(
"Parameter type may not specify the void datatype - empty parameter list should be used");