summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Fels <simon.fels@canonical.com>2016-01-25 14:38:07 (GMT)
committerSimon Fels <simon.fels@canonical.com>2016-01-25 14:38:07 (GMT)
commit14fa711f87fca6c3fec5d0b6971da8ac2cb2acd4 (patch)
treedd068acde5d9eeeb4ae24efbec1a0df3ed389f4e
parent931912b064a7195eaab91ad113860facc537e801 (diff)
hybris: common: add simple macro to check for existing symbolssymbol-check
-rw-r--r--hybris/include/hybris/common/binding.h11
-rw-r--r--utils/generate_wrapper_macros.py6
2 files changed, 14 insertions, 3 deletions
diff --git a/hybris/include/hybris/common/binding.h b/hybris/include/hybris/common/binding.h
index 779e45c..9541eb4 100644
--- a/hybris/include/hybris/common/binding.h
+++ b/hybris/include/hybris/common/binding.h
@@ -32,7 +32,6 @@ const char *android_dlerror(void);
int android_dladdr(const void *addr, void *info);
-
/**
* XXX AUTO-GENERATED FILE XXX
*
@@ -41,7 +40,7 @@ int android_dladdr(const void *addr, void *info);
* an updated version of this header file:
*
* python utils/generate_wrapper_macros.py > \
- * hybris/include/hybris/common/binding.h
+ * hybris/include/hybris/internal/binding.h
*
* If you need macros with more arguments, just customize the
* MAX_ARGS variable in generate_wrapper_macros.py.
@@ -65,6 +64,12 @@ int android_dladdr(const void *addr, void *info);
name##_handle = android_dlopen(path, RTLD_LAZY); \
}
+#define HYBRIS_LIRBARY_CHECK_SYMBOL(name) \
+ bool hybris_##name##_check_for_symbol(const char *sym) \
+ { \
+ return android_dlsym(name##_handle, sym) != NULL;
+ }
+
#define HYBRIS_IMPLEMENT_FUNCTION0(name, return_type, symbol) \
@@ -435,7 +440,7 @@ int android_dladdr(const void *addr, void *info);
* an updated version of this header file:
*
* python utils/generate_wrapper_macros.py > \
- * hybris/include/hybris/common/binding.h
+ * hybris/include/hybris/internal/binding.h
*
* If you need macros with more arguments, just customize the
* MAX_ARGS variable in generate_wrapper_macros.py.
diff --git a/utils/generate_wrapper_macros.py b/utils/generate_wrapper_macros.py
index d8b0d87..8d16a94 100644
--- a/utils/generate_wrapper_macros.py
+++ b/utils/generate_wrapper_macros.py
@@ -104,6 +104,12 @@ print """
name##_handle = android_dlopen(path, RTLD_LAZY); \\
}
+#define HYBRIS_LIRBARY_CHECK_SYMBOL(name) \\
+ bool hybris_##name##_check_for_symbol(const char *sym) \\
+ { \\
+ return android_dlsym(name##_handle, sym) != NULL;
+ }
+
"""
for count in range(MAX_ARGS):