]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephsqlite: hide non-public symbols
authorKefu Chai <kchai@redhat.com>
Sun, 21 Mar 2021 15:02:44 +0000 (23:02 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 23 Mar 2021 03:36:41 +0000 (11:36 +0800)
mark public interfaces using `[[gnu::visibility("default")]]`, so
we can expose them when the default visibility is "hidden".

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/SimpleRADOSStriper.h
src/include/libcephsqlite.h

index 2e7984870f9085e3e9b70386d505f3edbc9fcbbd..c5d3f5090ee39c4375fdf4b28991f17a7563c929 100644 (file)
@@ -27,7 +27,7 @@
 #include "common/ceph_time.h"
 #include "common/perf_counters.h"
 
-class SimpleRADOSStriper
+class [[gnu::visibility("default")]] SimpleRADOSStriper
 {
 public:
   using aiocompletionptr = std::unique_ptr<librados::AioCompletion>;
index 0fd1b5fd5604fd4dcf86e1312fd4dc6801c2c0f2..d81cc55e8a9fbb062df07c544110143d250cd232 100644 (file)
 #ifdef _WIN32
 #  define LIBCEPHSQLITE_API __declspec(dllexport)
 #else
-#  define LIBCEPHSQLITE_API extern "C"
+#  define LIBCEPHSQLITE_API [[gnu::visibility("default")]]
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 /* This is the SQLite entry point when loaded as a dynamic library. You also
  * need to ensure SQLite calls this method when using libcephsqlite as a static
  * library or a dynamic library linked at compile time. For the latter case,
@@ -63,5 +66,8 @@ LIBCEPHSQLITE_API int sqlite3_cephsqlite_init(sqlite3* db, char** err, const sql
  */
 
 LIBCEPHSQLITE_API int cephsqlite_setcct(class CephContext* cct, char** ident);
+#ifdef __cplusplus
+}
+#endif
 
 #endif