summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-10-30 17:47:38 +0100
committerStanislaw Halik <sthalik@misaki.pl>2013-10-30 17:47:38 +0100
commit4501ea093dadd3c44e88da9901eff683b0a91614 (patch)
treeee51852d20823c31e2f1f128607f8ceb196343d0
parent5d8e37f8cb37e6c583f51f188dbd00576d5f77ba (diff)
add visibility modifiers for GNU C
-rw-r--r--opentrack-api/opentrack-guts.h10
-rw-r--r--opentrack-api/opentrack.h20
2 files changed, 21 insertions, 9 deletions
diff --git a/opentrack-api/opentrack-guts.h b/opentrack-api/opentrack-guts.h
index 1061d75d..3f8806cc 100644
--- a/opentrack-api/opentrack-guts.h
+++ b/opentrack-api/opentrack-guts.h
@@ -11,9 +11,15 @@
#include <iostream>
#include <cstring>
+#ifdef __GNUC__
+# define OPENTRACK_HIDDEN __attribute__((visibility ("hidden")))
+#else
+# define OPENTRACK_HIDDEN
+#endif
+
typedef ITracker* opentrack_tracker;
-class opentrack_meta {
+class OPENTRACK_HIDDEN opentrack_meta {
public:
Metadata* meta;
QString path;
@@ -29,7 +35,7 @@ public:
}
};
-typedef class opentrack_ctx {
+typedef class OPENTRACK_HIDDEN opentrack_ctx {
public:
QDir dir;
char** list;
diff --git a/opentrack-api/opentrack.h b/opentrack-api/opentrack.h
index 8d28b5b8..95339d08 100644
--- a/opentrack-api/opentrack.h
+++ b/opentrack-api/opentrack.h
@@ -25,6 +25,12 @@ typedef opentrack_opaque_tracker* opentrack_tracker;
# endif
#endif
+#ifdef __GNUC__
+# define OPENTRACK_VISIBLE __attribute__((visibility ("default")))
+#else
+# define OPENTRACK_VISIBLE
+#endif
+
/* for `opentrack_tracker_tick', individual headpose elts */
#ifndef IN_OPENTRACK
enum opentrack_dof {
@@ -38,20 +44,20 @@ enum opentrack_dof {
};
#endif
-opentrack opentrack_make_ctx(const char* dir);
-void opentrack_finalize_ctx(opentrack self);
+opentrack OPENTRACK_VISIBLE opentrack_make_ctx(const char* dir);
+void OPENTRACK_VISIBLE opentrack_finalize_ctx(opentrack self);
/* no need to free the return value; invalid to modify it */
-const char** opentrack_enum_trackers(opentrack self);
+const char** OPENTRACK_VISIBLE opentrack_enum_trackers(opentrack self);
/*
* don't `opentrack_tracker_tick an unstarted tracker, it's invalid to do so
* it's also invalid to start a finalized tracker
*/
-opentrack_tracker opentrack_make_tracker(opentrack ctx, const char* name);
-void opentrack_tracker_start(opentrack self, opentrack_tracker tracker);
-int opentrack_tracker_tick(opentrack_tracker tracker, double* headpose);
-void opentrack_finalize_tracker(opentrack_tracker tracker);
+opentrack_tracker OPENTRACK_VISIBLE opentrack_make_tracker(opentrack ctx, const char* name);
+void OPENTRACK_VISIBLE opentrack_tracker_start(opentrack self, opentrack_tracker tracker);
+int OPENTRACK_VISIBLE opentrack_tracker_tick(opentrack_tracker tracker, double* headpose);
+void OPENTRACK_VISIBLE opentrack_finalize_tracker(opentrack_tracker tracker);
#ifdef __cplusplus
}
#endif