Interface: Apply guard to avoid redefinition error
Apply guard to make the definition of psa_status_t type conditional for
avoiding its redefinition. The psa_status_t type must be defined in the
psa/error.h header file according to the PSA FF 1.0 document. However,
it is also defined in psa/crypto_types.h because PSA crypto can be
deployed on a target which doesn't provide psa/error.h.
Change-Id: Id6471aab341b6e5b630bf33736ac64628a95cd75
Signed-off-by: David Vincze <david.vincze@arm.com>
diff --git a/interface/include/psa/error.h b/interface/include/psa/error.h
index 1107a24..439dba4 100644
--- a/interface/include/psa/error.h
+++ b/interface/include/psa/error.h
@@ -19,7 +19,13 @@
extern "C" {
#endif
+/* If #PSA_SUCCESS is already defined, it means that #psa_status_t
+ * is also defined in an external header, so prevent its multiple
+ * definition.
+ */
+#ifndef PSA_SUCCESS
typedef int32_t psa_status_t;
+#endif
#define PSA_SUCCESS ((psa_status_t)0)