diff options
author | Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org> | 2018-05-15 00:26:21 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2018-05-22 18:42:10 +0300 |
commit | c5b855df5b9e4388efd387810959b0f81f072fc9 (patch) | |
tree | 7201636947d3b1a60af1e7cd9f06c80d76bd9590 | |
parent | 7299adcc939a3d55b2c694744037ea9ea1dd7835 (diff) |
linux-gen: std clib: rework code to follow inlining style
Rework std clib module to follow _ODP_INLINE style of code used by the rest
of ODP codebase.
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
-rw-r--r-- | platform/linux-generic/Makefile.am | 2 | ||||
-rw-r--r-- | platform/linux-generic/include/odp/api/plat/std_clib_inlines.h | 18 | ||||
-rw-r--r-- | platform/linux-generic/odp_std_clib_api.c (renamed from platform/linux-generic/odp_std_clib.c) | 2 |
3 files changed, 14 insertions, 8 deletions
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 04c04f7cf..fb212950d 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -216,7 +216,7 @@ __LIB__libodp_linux_la_SOURCES += \ odp_packet_api.c \ odp_packet_flags_api.c \ odp_pktio_api.c \ - odp_std_clib.c \ + odp_std_clib_api.c \ odp_sync_api.c \ odp_thread_api.c \ odp_ticketlock_api.c diff --git a/platform/linux-generic/include/odp/api/plat/std_clib_inlines.h b/platform/linux-generic/include/odp/api/plat/std_clib_inlines.h index c07b57b73..4265eaf1d 100644 --- a/platform/linux-generic/include/odp/api/plat/std_clib_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/std_clib_inlines.h @@ -7,12 +7,20 @@ #ifndef ODP_PLAT_STD_CLIB_INLINE_H_ #define ODP_PLAT_STD_CLIB_INLINE_H_ -#ifdef __cplusplus -extern "C" { -#endif +/** @cond _ODP_HIDE_FROM_DOXYGEN_ */ #include <string.h> +#ifndef _ODP_NO_INLINE + /* Inline functions by default */ + #define _ODP_INLINE static inline + #define odp_memcpy __odp_memcpy + #define odp_memset __odp_memset + #define odp_memcmp __odp_memcmp +#else + #define _ODP_INLINE +#endif + _ODP_INLINE void *odp_memcpy(void *dst, const void *src, size_t num) { return memcpy(dst, src, num); @@ -28,8 +36,6 @@ _ODP_INLINE int odp_memcmp(const void *ptr1, const void *ptr2, size_t num) return memcmp(ptr1, ptr2, num); } -#ifdef __cplusplus -} -#endif +/** @endcond */ #endif diff --git a/platform/linux-generic/odp_std_clib.c b/platform/linux-generic/odp_std_clib_api.c index f43f62c9d..faa378473 100644 --- a/platform/linux-generic/odp_std_clib.c +++ b/platform/linux-generic/odp_std_clib_api.c @@ -9,5 +9,5 @@ #include <odp/api/std_clib.h> /* Include non-inlined versions of API functions */ -#define _ODP_INLINE +#define _ODP_NO_INLINE #include <odp/api/plat/std_clib_inlines.h> |