Skip to content

Commit

Permalink
liblegacy|libshell: Symbol visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent 4aaf6d1 commit d6fd19e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions doomsday/libs/legacy/include/de/liblegacy.h
Expand Up @@ -55,6 +55,7 @@
#include <assert.h>
#include <stddef.h>

#if !defined (DE_PUBLIC)
/*
* The DE_PUBLIC macro is used for declaring exported symbols. It must be
* applied in all exported classes and functions. DEF files are not used for
Expand All @@ -63,16 +64,21 @@
#if defined(_WIN32) && defined(_MSC_VER)
# ifdef __DE__
// This is defined when compiling the library.
# define DE_PUBLIC __declspec(dllexport)
# define DE_PUBLIC __declspec(dllexport)
# else
# define DE_PUBLIC __declspec(dllimport)
# define DE_PUBLIC __declspec(dllimport)
# endif
# define DE_NORETURN __declspec(noreturn)
# define DE_NORETURN __declspec(noreturn)
#elif defined (MACOSX)
# define DE_PUBLIC __attribute__((visibility("default")))
# define DE_NORETURN __attribute__((__noreturn__))
#else
# define DE_PUBLIC
# define DE_NORETURN __attribute__((__noreturn__))
# define DE_NORETURN __attribute__((__noreturn__))
#endif

#endif // !defined (DE_PUBLIC)

#if defined (DE_IOS)
# define DE_VISIBLE_SYMBOL __attribute__((visibility("default")))
#else
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/shell/include/de/shell/libshell.h
Expand Up @@ -47,7 +47,7 @@
# endif
#else
// No need to use any special declarators.
# define LIBSHELL_PUBLIC
# define LIBSHELL_PUBLIC DE_PUBLIC
#endif

namespace de {
Expand Down

0 comments on commit d6fd19e

Please sign in to comment.