Skip to content

Commit

Permalink
Merge pull request Cyan4973#166 from LambdAurora/dev
Browse files Browse the repository at this point in the history
 Added export of public symbols on Windows.
  • Loading branch information
Cyan4973 committed Feb 13, 2019
2 parents d6f83c4 + c56b856 commit 589e517
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cmake_unofficial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ include_directories("${XXHASH_DIR}")

# libxxhash
add_library(xxhash "${XXHASH_DIR}/xxhash.c")
if (BUILD_SHARED_LIBS)
target_compile_definitions(xxhash PUBLIC XXH_EXPORT)
endif ()
set_target_properties(xxhash PROPERTIES
SOVERSION "${XXHASH_VERSION_STRING}"
VERSION "${XXHASH_VERSION_STRING}")
Expand Down
10 changes: 9 additions & 1 deletion xxhash.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,15 @@ typedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode;
# define XXH_PUBLIC_API static
# endif
#else
# define XXH_PUBLIC_API /* do nothing */
# if defined(WIN32) && !defined(__GNUC__)
# ifdef XXH_EXPORT
# define XXH_PUBLIC_API __declspec(dllexport)
# else
# define XXH_PUBLIC_API __declspec(dllimport)
# endif
# else
# define XXH_PUBLIC_API /* do nothing */
# endif
#endif /* XXH_INLINE_ALL || XXH_PRIVATE_API */

/*! XXH_NAMESPACE, aka Namespace Emulation :
Expand Down

0 comments on commit 589e517

Please sign in to comment.