aboutsummaryrefslogtreecommitdiff
path: root/tests/GenerateSipBindings/cpplib.h
diff options
context:
space:
mode:
authorShaheed Haque <srhaque@theiet.org>2017-02-04 11:00:16 +0000
committerStephen Kelly <steveire@gmail.com>2017-02-04 11:27:15 +0000
commit050f15ef6a0c44dc6a7abbbe0f1954ea1925f473 (patch)
tree2e28042d4fd929d863a7c1e48d0a32d54ff9eb55 /tests/GenerateSipBindings/cpplib.h
parent4e17330a4520b1994a6488993a2a887f1f051d72 (diff)
downloadextra-cmake-modules-050f15ef6a0c44dc6a7abbbe0f1954ea1925f473.tar.gz
extra-cmake-modules-050f15ef6a0c44dc6a7abbbe0f1954ea1925f473.tar.bz2
Bindings: Take account of visibility attribute on APIs
Don't export API which has visibility "hidden". Visibility attributes on variables are ignored, but call the generic method anyway. Remove checks for macros which obscure the attributes. Processing the attribute directly means that is not needed.
Diffstat (limited to 'tests/GenerateSipBindings/cpplib.h')
-rw-r--r--tests/GenerateSipBindings/cpplib.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/GenerateSipBindings/cpplib.h b/tests/GenerateSipBindings/cpplib.h
index a91b5486..b3ea22a8 100644
--- a/tests/GenerateSipBindings/cpplib.h
+++ b/tests/GenerateSipBindings/cpplib.h
@@ -203,3 +203,13 @@ enum __attribute__((visibility("default"))) EnumWithAttributes {
Foo,
Bar = 2
};
+
+#define EXPORT __attribute__((visibility("default")))
+#define NO_EXPORT __attribute__((visibility("hidden")))
+
+class EXPORT Visible
+{
+public:
+ EXPORT int visible_fn() { return 1; }
+ NO_EXPORT int invisible_fn() { return 1; }
+};