equal
deleted
inserted
replaced
15 #endif |
15 #endif |
16 |
16 |
17 /*===== dependency =====*/ |
17 /*===== dependency =====*/ |
18 #include <stddef.h> /* size_t */ |
18 #include <stddef.h> /* size_t */ |
19 |
19 |
|
20 |
|
21 /* ===== ZSTDERRORLIB_API : control library symbols visibility ===== */ |
|
22 #if defined(__GNUC__) && (__GNUC__ >= 4) |
|
23 # define ZSTDERRORLIB_VISIBILITY __attribute__ ((visibility ("default"))) |
|
24 #else |
|
25 # define ZSTDERRORLIB_VISIBILITY |
|
26 #endif |
|
27 #if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1) |
|
28 # define ZSTDERRORLIB_API __declspec(dllexport) ZSTDERRORLIB_VISIBILITY |
|
29 #elif defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1) |
|
30 # define ZSTDERRORLIB_API __declspec(dllimport) ZSTDERRORLIB_VISIBILITY /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/ |
|
31 #else |
|
32 # define ZSTDERRORLIB_API ZSTDERRORLIB_VISIBILITY |
|
33 #endif |
20 |
34 |
21 /*-**************************************** |
35 /*-**************************************** |
22 * error codes list |
36 * error codes list |
23 ******************************************/ |
37 ******************************************/ |
24 typedef enum { |
38 typedef enum { |
47 } ZSTD_ErrorCode; |
61 } ZSTD_ErrorCode; |
48 |
62 |
49 /*! ZSTD_getErrorCode() : |
63 /*! ZSTD_getErrorCode() : |
50 convert a `size_t` function result into a `ZSTD_ErrorCode` enum type, |
64 convert a `size_t` function result into a `ZSTD_ErrorCode` enum type, |
51 which can be used to compare directly with enum list published into "error_public.h" */ |
65 which can be used to compare directly with enum list published into "error_public.h" */ |
52 ZSTD_ErrorCode ZSTD_getErrorCode(size_t functionResult); |
66 ZSTDERRORLIB_API ZSTD_ErrorCode ZSTD_getErrorCode(size_t functionResult); |
53 const char* ZSTD_getErrorString(ZSTD_ErrorCode code); |
67 ZSTDERRORLIB_API const char* ZSTD_getErrorString(ZSTD_ErrorCode code); |
54 |
68 |
55 |
69 |
56 #if defined (__cplusplus) |
70 #if defined (__cplusplus) |
57 } |
71 } |
58 #endif |
72 #endif |