Several ODP APIs require that the application is able to replace them with
a more appropriate definition. By defining an ODP function as weak the linker
is able to replace the definition with the one supplied by the application.

Signed-off-by: Mike Holmes <[email protected]>
---
 platform/linux-generic/include/api/odp_hints.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/platform/linux-generic/include/api/odp_hints.h 
b/platform/linux-generic/include/api/odp_hints.h
index bc6d720..7f04886 100644
--- a/platform/linux-generic/include/api/odp_hints.h
+++ b/platform/linux-generic/include/api/odp_hints.h
@@ -25,6 +25,11 @@ extern "C" {
 
 #ifdef __GNUC__
 
+/** Define a weak symbol
+ * This is primarily useful in defining library functions that can be
+ * overridden in user code.
+ */
+#define ODP_WEAK_SYMBOL __attribute__((__weak__))
 
 /**
  * Hot code section
@@ -68,6 +73,7 @@ extern "C" {
 
 #else
 
+#define ODP_WEAK_SYMBOL
 #define ODP_HOT_CODE
 #define ODP_COLD_CODE
 #define odp_likely(x)
-- 
2.1.0


_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to