Skip to content

Commit b6844a9

Browse files
tweak static export header definitions
1 parent bfeb838 commit b6844a9

File tree

2 files changed

+33
-17
lines changed

2 files changed

+33
-17
lines changed

extensions/include/cmark-gfm-extensions_export.h

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,39 @@
66
# define CMARK_GFM_EXTENSIONS_EXPORT
77
# define CMARK_GFM_EXTENSIONS_NO_EXPORT
88
#else
9-
# ifndef CMARK_GFM_EXTENSIONS_EXPORT
10-
# ifdef libcmark_gfm_extensions_EXPORTS
11-
/* We are building this library */
12-
# define CMARK_GFM_EXTENSIONS_EXPORT __attribute__((visibility("default")))
13-
# else
14-
/* We are using this library */
15-
# define CMARK_GFM_EXTENSIONS_EXPORT __attribute__((visibility("default")))
9+
# if defined(_WIN32)
10+
# ifndef CMARK_GFM_EXTENSIONS_EXPORT
11+
# ifdef libcmark_gfm_extensions_EXPORTS
12+
# define CMARK_GFM_EXTENSIONS_EXPORT __declspec(dllexport)
13+
# else
14+
# define CMARK_GFM_EXTENSIONS_EXPORT __declspec(dllimport)
15+
# endif
16+
# endif
17+
18+
# ifndef CMARK_GFM_EXTENSIONS_NO_EXPORT
19+
# define CMARK_GFM_EXTENSIONS_NO_EXPORT
20+
# endif
21+
# else
22+
# ifndef CMARK_GFM_EXTENSIONS_EXPORT
23+
# ifdef libcmark_gfm_extensions_EXPORTS
24+
# define CMARK_GFM_EXTENSIONS_EXPORT __attribute__((visibility("default")))
25+
# else
26+
# define CMARK_GFM_EXTENSIONS_EXPORT __attribute__((visibility("default")))
27+
# endif
1628
# endif
17-
# endif
1829

19-
# ifndef CMARK_GFM_EXTENSIONS_NO_EXPORT
20-
# define CMARK_GFM_EXTENSIONS_NO_EXPORT __attribute__((visibility("hidden")))
30+
# ifndef CMARK_GFM_EXTENSIONS_NO_EXPORT
31+
# define CMARK_GFM_EXTENSIONS_NO_EXPORT __attribute__((visibility("hidden")))
32+
# endif
2133
# endif
2234
#endif
2335

2436
#ifndef CMARK_GFM_EXTENSIONS_DEPRECATED
25-
# define CMARK_GFM_EXTENSIONS_DEPRECATED __attribute__ ((__deprecated__))
37+
# if !defined(_WIN32)
38+
# define CMARK_GFM_EXTENSIONS_DEPRECATED __attribute__ ((__deprecated__))
39+
# else
40+
# define CMARK_GFM_EXTENSIONS_DEPRECATED
41+
# endif
2642
#endif
2743

2844
#ifndef CMARK_GFM_EXTENSIONS_DEPRECATED_EXPORT

src/include/cmark-gfm_export.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@
1515
# define CMARK_GFM_NO_EXPORT
1616
# else
1717
# if defined(libcmark_gfm_EXPORTS)
18-
# if defined(__linux__)
19-
# define CMARK_GFM_EXPORT __attribute__((__visibility__("protected")))
20-
# else
21-
# define CMARK_GFM_EXPORT __attribute__((__visibility__("default")))
22-
# endif
18+
# define CMARK_GFM_EXPORT __attribute__((__visibility__("default")))
2319
# else
2420
# define CMARK_GFM_EXPORT __attribute__((__visibility__("default")))
2521
# endif
@@ -28,7 +24,11 @@
2824
#endif
2925

3026
#ifndef CMARK_GFM_DEPRECATED
31-
# define CMARK_GFM_DEPRECATED __attribute__ ((__deprecated__))
27+
# if !defined(_WIN32)
28+
# define CMARK_GFM_DEPRECATED __attribute__ ((__deprecated__))
29+
# else
30+
# define CMARK_GFM_DEPRECATED
31+
# endif
3232
#endif
3333

3434
#ifndef CMARK_GFM_DEPRECATED_EXPORT

0 commit comments

Comments
 (0)