Merge pull request #181 from LambdAurora/dev

Fixed the 'dllimport' build issue with MSVC.
This commit is contained in:
Yann Collet 2019-03-16 10:07:22 -07:00 committed by GitHub
commit f3e08d7ea9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -92,6 +92,7 @@ they modify xxhash behavior. They are all disabled by default.
Incompatible with dynamic linking, due to risks of ABI changes.
- `XXH_NO_LONG_LONG` : removes support for XXH64,
for targets without 64-bit support.
- `XXH_IMPORT` : should only be defined for dynamic linking, it prevents linkage errors with MSVC.
### Example

View File

@ -107,10 +107,10 @@ typedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode;
# define XXH_PUBLIC_API static
# endif
#else
# if defined(WIN32) && defined(_MSC_VER)
# if defined(WIN32) && defined(_MSC_VER) && (defined(XXH_IMPORT) || defined(XXH_EXPORT))
# ifdef XXH_EXPORT
# define XXH_PUBLIC_API __declspec(dllexport)
# else
# elif XXH_IMPORT
# define XXH_PUBLIC_API __declspec(dllimport)
# endif
# else