]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
objclass-sdk: expose __cls_init() to the world 21581/head
authorKefu Chai <kchai@redhat.com>
Sat, 21 Apr 2018 08:41:55 +0000 (16:41 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 21 Apr 2018 09:15:59 +0000 (17:15 +0800)
the __cls_init() function should be visible. otherwise we cannot call it
to register the cls methods

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/cls/sdk/cls_sdk.cc
src/include/rados/objclass.h
src/objclass/objclass.h

index 1f907b498029ec88182824a2aeb3e07be2c7491e..95b5096a7d1daea5b12acab1f128041589e728b7 100644 (file)
@@ -115,7 +115,7 @@ static int test_coverage_replay(cls_method_context_t hctx, bufferlist *in, buffe
   return 0;
 }
 
-void __cls_init()
+CLS_INIT(sdk)
 {
   CLS_LOG(0, "loading cls_sdk");
 
index ea07dfc790aefc9708bced9dd90082ae6ab18067..cd1432fcf52f0d3bf7cc50350985bb44c2522872 100644 (file)
@@ -20,13 +20,15 @@ int __cls_ver_min = min;
 #define CLS_NAME(name) \
 int __cls_name__## name = 0; \
 const char *__cls_name = #name;
+
+#define CEPH_CLS_API [[gnu::visibility("default")]]
 #define CLS_INIT(name) \
-void CEPH_CLS_API __cls_init()
+CEPH_CLS_API void __cls_init()
 #else
 #define CLS_VER(maj,min)
 #define CLS_NAME(name)
 #define CLS_INIT(name) \
-void CEPH_CLS_API name##_cls_init()
+CEPH_CLS_API void name##_cls_init()
 #endif
 
 #define CLS_METHOD_RD       0x1 /// method executes read operations
index cd41153dafcf5447d9e93700196be57a2cd5f877..f20bf49ae0e5d89600d97d552650206cbdcf139e 100644 (file)
 
 struct obj_list_watch_response_t;
 
-#if __GNUC__ >= 4
-  #define CEPH_CLS_API    __attribute__ ((visibility ("default")))
-#else
-  #define CEPH_CLS_API
-#endif
-
 extern "C" {
 #endif