1 /* 2 Written in the D programming language. 3 For git maintenance (ensure at least one congruent line with originating C header): 4 #define sodium_export_H 5 */ 6 7 module deimos.sodium.export_; 8 9 /+ 10 #if !defined(__clang__) && !defined(__GNUC__) 11 # ifdef __attribute__ 12 # undef __attribute__ 13 # endif 14 # define __attribute__(a) 15 #endif 16 17 #ifdef SODIUM_STATIC 18 # define SODIUM_EXPORT 19 # define SODIUM_EXPORT_WEAK 20 #else 21 # if defined(_MSC_VER) 22 # ifdef SODIUM_DLL_EXPORT 23 # define SODIUM_EXPORT __declspec(dllexport) 24 # else 25 # define SODIUM_EXPORT __declspec(dllimport) 26 # endif 27 # else 28 # if defined(__SUNPRO_C) 29 # ifndef __GNU_C__ 30 # define SODIUM_EXPORT __attribute__ (visibility(__global)) 31 # else 32 # define SODIUM_EXPORT __attribute__ __global 33 # endif 34 # elif defined(_MSG_VER) 35 # define SODIUM_EXPORT extern __declspec(dllexport) 36 # else 37 # define SODIUM_EXPORT __attribute__ ((visibility ("default"))) 38 # endif 39 # endif 40 # if defined(__ELF__) && !defined(SODIUM_DISABLE_WEAK_FUNCTIONS) 41 # define SODIUM_EXPORT_WEAK SODIUM_EXPORT __attribute__((weak)) 42 # else 43 # define SODIUM_EXPORT_WEAK SODIUM_EXPORT 44 # endif 45 #endif 46 47 #ifndef CRYPTO_ALIGN 48 # if defined(__INTEL_COMPILER) || defined(_MSC_VER) 49 # define CRYPTO_ALIGN(x) __declspec(align(x)) 50 # else 51 # define CRYPTO_ALIGN(x) __attribute__ ((aligned(x))) 52 # endif 53 #endif 54 +/ 55 56 import std.algorithm.comparison : min; 57 58 alias SODIUM_MIN = min; 59 enum SODIUM_SIZE_MAX = SODIUM_MIN(ulong.max, size_t.max);