mirror of
https://github.com/BLAKE2/libb2
synced 2024-11-22 20:21:59 +01:00
PREFIX DLL HELPER SYMBOLS WITH BLAKE2
This commit is contained in:
parent
27691aa58c
commit
b54f34c1d5
34
src/blake2.h
34
src/blake2.h
@ -17,31 +17,27 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef DLL_HELPER_DEFINED
|
||||
#define DLL_HELPER_DEFINED
|
||||
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
#define _DLL_IMPORT __declspec(dllimport)
|
||||
#define _DLL_EXPORT __declspec(dllexport)
|
||||
#define _DLL_PRIVATE
|
||||
#elif __GNUC__ >= 4
|
||||
#define _DLL_IMPORT __attribute__ ((visibility ("default")))
|
||||
#define _DLL_EXPORT __attribute__ ((visibility ("default")))
|
||||
#define _DLL_PRIVATE __attribute__ ((visibility ("hidden")))
|
||||
#else
|
||||
#define _DLL_IMPORT
|
||||
#define _DLL_EXPORT
|
||||
#define _DLL_PRIVATE
|
||||
#endif
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
#define BLAKE2_DLL_IMPORT __declspec(dllimport)
|
||||
#define BLAKE2_DLL_EXPORT __declspec(dllexport)
|
||||
#define BLAKE2_DLL_PRIVATE
|
||||
#elif __GNUC__ >= 4
|
||||
#define BLAKE2_DLL_IMPORT __attribute__ ((visibility ("default")))
|
||||
#define BLAKE2_DLL_EXPORT __attribute__ ((visibility ("default")))
|
||||
#define BLAKE2_DLL_PRIVATE __attribute__ ((visibility ("hidden")))
|
||||
#else
|
||||
#define BLAKE2_DLL_IMPORT
|
||||
#define BLAKE2_DLL_EXPORT
|
||||
#define BLAKE2_DLL_PRIVATE
|
||||
#endif
|
||||
|
||||
#if defined(BLAKE2_DLL)
|
||||
#if defined(BLAKE2_DLL_EXPORTS) // defined if we are building the DLL
|
||||
#define BLAKE2_API _DLL_EXPORT
|
||||
#define BLAKE2_API BLAKE2_DLL_EXPORT
|
||||
#else
|
||||
#define BLAKE2_API _DLL_IMPORT
|
||||
#define BLAKE2_API BLAKE2_DLL_IMPORT
|
||||
#endif
|
||||
#define BLAKE2_PRIVATE _DLL_PRIVATE // must only be used by hidden logic
|
||||
#define BLAKE2_PRIVATE BLAKE2_DLL_PRIVATE // must only be used by hidden logic
|
||||
#else
|
||||
#define BLAKE2_API
|
||||
#define BLAKE2_PRIVATE
|
||||
|
Loading…
Reference in New Issue
Block a user