diff --git a/src/as-desktop-entry.h b/src/as-desktop-entry.h index a9e7f142b..1a59e4ced 100644 --- a/src/as-desktop-entry.h +++ b/src/as-desktop-entry.h @@ -27,8 +27,7 @@ #include "as-metadata.h" #include "as-utils-private.h" -G_BEGIN_DECLS -#pragma GCC visibility push(hidden) +AS_BEGIN_PRIVATE_DECLS typedef GPtrArray *(*AsTranslateDesktopTextFn) (const GKeyFile *de, const gchar *text, @@ -54,7 +53,6 @@ gboolean as_desktop_entry_parse_file (AsComponent *cpt, gpointer user_data, GError **error); -#pragma GCC visibility pop -G_END_DECLS +AS_END_PRIVATE_DECLS #endif /* __AS_DESKTOP_ENTRY_H */ diff --git a/src/as-macros-private.h b/src/as-macros-private.h index d7d4bddaa..ada678cca 100644 --- a/src/as-macros-private.h +++ b/src/as-macros-private.h @@ -26,6 +26,22 @@ #include "as-macros.h" G_BEGIN_DECLS + +#ifdef _MSC_VER + +#define AS_BEGIN_PRIVATE_DECLS G_BEGIN_DECLS +#define AS_END_PRIVATE_DECLS G_END_DECLS + +#ifdef AS_STATIC +# define AS_INTERNAL_VISIBLE +#else +# define AS_INTERNAL_VISIBLE __declspec(dllexport) +#endif + +#define AS_INTERNAL_API AS_INTERNAL_VISIBLE + +#else + #pragma GCC visibility push(hidden) #define AS_BEGIN_PRIVATE_DECLS \ @@ -35,6 +51,9 @@ G_BEGIN_DECLS #define AS_END_PRIVATE_DECLS _Pragma ("GCC visibility pop") G_END_DECLS #define AS_INTERNAL_VISIBLE __attribute__((visibility("default"))) +#define AS_INTERNAL_API + +#endif /** * as_str_equal0: @@ -107,7 +126,10 @@ G_BEGIN_DECLS } \ G_STMT_END +#ifndef _MSC_VER #pragma GCC visibility pop +#endif + G_END_DECLS #endif /* __AS_MACROS_PRIVATE_H */