1 
2 #ifndef sodium_export_H
3 #define sodium_export_H
4 
5 #ifndef __GNUC__
6 # ifdef __attribute__
7 #  undef __attribute__
8 # endif
9 # define __attribute__(a)
10 #endif
11 
12 #ifdef SODIUM_STATIC
13 # define SODIUM_EXPORT
14 # define SODIUM_EXPORT_WEAK
15 #else
16 # if defined(_MSC_VER)
17 #  ifdef SODIUM_DLL_EXPORT
18 #   define SODIUM_EXPORT __declspec(dllexport)
19 #  else
20 #   define SODIUM_EXPORT __declspec(dllimport)
21 #  endif
22 # else
23 #  if defined(__SUNPRO_C)
24 #   ifndef __GNU_C__
25 #    define SODIUM_EXPORT __attribute__ (visibility(__global))
26 #   else
27 #    define SODIUM_EXPORT __attribute__ __global
28 #   endif
29 #  elif defined(_MSG_VER)
30 #   define SODIUM_EXPORT extern __declspec(dllexport)
31 #  else
32 #   define SODIUM_EXPORT __attribute__ ((visibility ("default")))
33 #  endif
34 # endif
35 # if defined(__ELF__) && !defined(SODIUM_DISABLE_WEAK_FUNCTIONS)
36 #  define SODIUM_EXPORT_WEAK SODIUM_EXPORT __attribute__((weak))
37 # else
38 #  define SODIUM_EXPORT_WEAK SODIUM_EXPORT
39 # endif
40 #endif
41 
42 #ifndef CRYPTO_ALIGN
43 # if defined(__INTEL_COMPILER) || defined(_MSC_VER)
44 #  define CRYPTO_ALIGN(x) __declspec(align(x))
45 # else
46 #  define CRYPTO_ALIGN(x) __attribute__ ((aligned(x)))
47 # endif
48 #endif
49 
50 #define SODIUM_MIN(A, B) ((A) < (B) ? (A) : (B))
51 #define SODIUM_SIZE_MAX SODIUM_MIN(UINT64_MAX, SIZE_MAX)
52 
53 #endif
54