* The new `PARCObjectDescriptor` uses the existing `PARCObjectDescriptor` as the super-type of the new descriptor.
*/
+#ifdef __clang__
#define parcObject_Extends(_subtype, _superType, ...) \
+ _Pragma("GCC diagnostic push") \
+ _Pragma("GCC diagnostic ignored \"-Winitializer-overrides\"") \
+ parcObjectDescriptor_Declaration(_subtype) = { \
+ .super = &parcObject_DescriptorName(_superType), \
+ .name = #_subtype, \
+ .objectSize = 0, \
+ .objectAlignment = 0, \
+ .destroy = NULL, \
+ .destructor = NULL, \
+ .release = NULL, \
+ .copy = NULL, \
+ .toString = NULL, \
+ .equals = NULL, \
+ .compare = NULL, \
+ .hashCode = NULL, \
+ .toJSON = NULL, \
+ .display = NULL, \
+ .isLockable = true, \
+ .typeState = NULL, \
+ __VA_ARGS__ \
+ }; \
+ _Pragma("GCC diagnostic pop") \
+ const PARCObjectDescriptor parcObject_DescriptorName(_subtype)
+#else
+ #define parcObject_Extends(_subtype, _superType, ...) \
_Pragma("GCC diagnostic ignored \"-Woverride-init\"") \
parcObjectDescriptor_Declaration(_subtype) = { \
.super = &parcObject_DescriptorName(_superType), \
}; \
_Pragma("GCC diagnostic warning \"-Woverride-init\"") \
const PARCObjectDescriptor parcObject_DescriptorName(_subtype)
+#endif
/**
* Define a new PARC Object implementation, by composing a new PARC Object Descriptor referencing an old one.
case PARCSigningAlgorithm_ECDSA:
certificate = parcX509Certificate_CreateSelfSignedCertificate(privateKey, subjectName, (int) keyLength, valdityDays, PARCKeyType_EC);
break;
+ default:
+ break;
}
// This may fail.
ec_key);
parcAssertTrue(result == 1, "Got error from ECDSA_sign: %d", result);
EC_KEY_free(ec_key);
-
+ return result;
}
static PARCSignature *
EVP_PKEY_free(privateKey);
break;
}
+ default:
+ break;
}
parcBuffer_Release(&privateKeyBuffer);
return _createSelfSignedCertificate_RSA(privateKeyBuffer, subjectName, keyLength, validityDays);
case PARCKeyType_EC:
return _createSelfSignedCertificate_EC(privateKeyBuffer, subjectName, keyLength, validityDays);
+ default:
+ break;
}
return NULL;