diff options
author | Zeng Tao | 2017-08-28 03:55:25 -0500 |
---|---|---|
committer | Jérôme Forissier | 2017-08-29 06:30:31 -0500 |
commit | 48107e5f3743be34536e476aea4824a0f68f9a30 (patch) | |
tree | 38caa333a38aaa213f352cca8a1f02309f70de84 | |
parent | 32d9b77918ee634d1a16299164b543d628291123 (diff) | |
download | ti-optee-client-48107e5f3743be34536e476aea4824a0f68f9a30.tar.gz ti-optee-client-48107e5f3743be34536e476aea4824a0f68f9a30.tar.xz ti-optee-client-48107e5f3743be34536e476aea4824a0f68f9a30.zip |
tee_client_api: support calling libteec from cplusplus
The tee client api has got no restriction for cplusplus program,
simplely add extern "c" in this patch to support this feature.
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Zeng Tao <prime.zeng@hisilicon.com>
-rw-r--r-- | public/tee_client_api.h | 8 | ||||
-rw-r--r-- | public/tee_client_api_extensions.h | 8 | ||||
-rw-r--r-- | public/teec_trace.h | 9 |
3 files changed, 25 insertions, 0 deletions
diff --git a/public/tee_client_api.h b/public/tee_client_api.h index 6a439709..a9d8a052 100644 --- a/public/tee_client_api.h +++ b/public/tee_client_api.h | |||
@@ -29,6 +29,10 @@ | |||
29 | #ifndef TEE_CLIENT_API_H | 29 | #ifndef TEE_CLIENT_API_H |
30 | #define TEE_CLIENT_API_H | 30 | #define TEE_CLIENT_API_H |
31 | 31 | ||
32 | #ifdef __cplusplus | ||
33 | extern "C" { | ||
34 | #endif | ||
35 | |||
32 | #include <stdint.h> | 36 | #include <stdint.h> |
33 | #include <stddef.h> | 37 | #include <stddef.h> |
34 | #include <limits.h> | 38 | #include <limits.h> |
@@ -535,4 +539,8 @@ void TEEC_ReleaseSharedMemory(TEEC_SharedMemory *sharedMemory); | |||
535 | */ | 539 | */ |
536 | void TEEC_RequestCancellation(TEEC_Operation *operation); | 540 | void TEEC_RequestCancellation(TEEC_Operation *operation); |
537 | 541 | ||
542 | #ifdef __cplusplus | ||
543 | } | ||
544 | #endif | ||
545 | |||
538 | #endif | 546 | #endif |
diff --git a/public/tee_client_api_extensions.h b/public/tee_client_api_extensions.h index 0d546a42..85298aad 100644 --- a/public/tee_client_api_extensions.h +++ b/public/tee_client_api_extensions.h | |||
@@ -29,6 +29,10 @@ | |||
29 | 29 | ||
30 | #include <tee_client_api.h> | 30 | #include <tee_client_api.h> |
31 | 31 | ||
32 | #ifdef __cplusplus | ||
33 | extern "C" { | ||
34 | #endif | ||
35 | |||
32 | /** | 36 | /** |
33 | * TEEC_RegisterMemoryFileDescriptor() - Register a block of existing memory as | 37 | * TEEC_RegisterMemoryFileDescriptor() - Register a block of existing memory as |
34 | * a shared block within the scope of the specified context. | 38 | * a shared block within the scope of the specified context. |
@@ -46,4 +50,8 @@ TEEC_Result TEEC_RegisterSharedMemoryFileDescriptor(TEEC_Context *context, | |||
46 | TEEC_SharedMemory *sharedMem, | 50 | TEEC_SharedMemory *sharedMem, |
47 | int fd); | 51 | int fd); |
48 | 52 | ||
53 | #ifdef __cplusplus | ||
54 | } | ||
55 | #endif | ||
56 | |||
49 | #endif /* TEE_CLIENT_API_EXTENSIONS_H */ | 57 | #endif /* TEE_CLIENT_API_EXTENSIONS_H */ |
diff --git a/public/teec_trace.h b/public/teec_trace.h index 1bd168e2..28e290ca 100644 --- a/public/teec_trace.h +++ b/public/teec_trace.h | |||
@@ -26,6 +26,11 @@ | |||
26 | */ | 26 | */ |
27 | #ifndef TEEC_TRACE_H | 27 | #ifndef TEEC_TRACE_H |
28 | #define TEEC_TRACE_H | 28 | #define TEEC_TRACE_H |
29 | |||
30 | #ifdef __cplusplus | ||
31 | extern "C" { | ||
32 | #endif | ||
33 | |||
29 | #include <string.h> | 34 | #include <string.h> |
30 | #include <stdio.h> | 35 | #include <stdio.h> |
31 | #include <stdint.h> | 36 | #include <stdint.h> |
@@ -135,4 +140,8 @@ int _dprintf(const char *function, int flen, int line, int level, | |||
135 | */ | 140 | */ |
136 | void dump_buffer(const char *bname, const uint8_t *buffer, size_t blen); | 141 | void dump_buffer(const char *bname, const uint8_t *buffer, size_t blen); |
137 | 142 | ||
143 | #ifdef __cplusplus | ||
144 | } | ||
145 | #endif | ||
146 | |||
138 | #endif | 147 | #endif |