File tree Expand file tree Collapse file tree 3 files changed +17
-6
lines changed Expand file tree Collapse file tree 3 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,12 @@ class FCITXCORE_EXPORT AddonInstance {
163
163
};
164
164
} // namespace fcitx
165
165
166
+ #if defined(_WIN32)
167
+ #define FCITX_ADDON_EXPORT __declspec (dllexport)
168
+ #else
169
+ #define FCITX_ADDON_EXPORT __attribute__ ((visibility(" default" )))
170
+ #endif
171
+
166
172
#define FCITX_ADDON_DECLARE_FUNCTION (NAME, FUNCTION, SIGNATURE... ) \
167
173
namespace fcitx { \
168
174
template <> \
@@ -194,15 +200,15 @@ class FCITXCORE_EXPORT AddonInstance {
194
200
195
201
#define FCITX_ADDON_FACTORY (ClassName ) \
196
202
extern " C" { \
197
- FCITXCORE_EXPORT ::fcitx::AddonFactory *fcitx_addon_factory_instance () { \
203
+ FCITX_ADDON_EXPORT ::fcitx::AddonFactory *fcitx_addon_factory_instance () { \
198
204
static ClassName factory; \
199
205
return &factory; \
200
206
} \
201
207
}
202
208
203
209
#define FCITX_ADDON_FACTORY_V2 (AddonName, ClassName ) \
204
210
extern " C" { \
205
- FCITXCORE_EXPORT ::fcitx::AddonFactory * \
211
+ FCITX_ADDON_EXPORT ::fcitx::AddonFactory * \
206
212
fcitx_addon_factory_instance_##AddonName() { \
207
213
static ClassName factory; \
208
214
return &factory; \
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ int main() {
37
37
pathfilter::extension (" .dict" ));
38
38
// Check if all languages are loadable.
39
39
for (const auto &[name, __] : files) {
40
- std::string lang = name.stem ();
40
+ std::string lang = name.stem (). string () ;
41
41
FCITX_ASSERT (emoji->call <IEmoji::check>(lang, false ))
42
42
<< " Failed to load " << lang;
43
43
}
Original file line number Diff line number Diff line change 6
6
*/
7
7
8
8
#include < string.h>
9
- #include " fcitx-utils/fcitxutils_export.h"
10
9
#include " fcitx-utils/library.h"
11
10
#include " fcitx-utils/log.h"
12
11
13
12
#define DATA " AAAAAAAAA"
14
13
#define MAGIC " MAGIC_TEST_DATA"
15
14
15
+ #if defined(_WIN32)
16
+ #define MY_EXPORT __declspec (dllexport)
17
+ #else
18
+ #define MY_EXPORT __attribute__ ((visibility(" default" )))
19
+ #endif
20
+
16
21
extern " C" {
17
- FCITXUTILS_EXPORT char magic_test[] = MAGIC DATA;
22
+ MY_EXPORT char magic_test[] = MAGIC DATA;
18
23
19
- FCITXUTILS_EXPORT int func () { return 0 ; }
24
+ MY_EXPORT int func () { return 0 ; }
20
25
}
21
26
22
27
void parser (const char *data) { FCITX_ASSERT (strcmp (data, DATA) == 0 ); }
You can’t perform that action at this time.
0 commit comments