ISARA Radiate Security Solution Suite Toolkit Edition Version 1.5

Quantum-safe cryptographic primitives and algorithms.

iqr_api.h
Go to the documentation of this file.
1 
85 #ifndef IQR_API_H
86 #define IQR_API_H
87 
88 #include <limits.h>
89 
92 /* Compatibility check. */
93 #if CHAR_BIT != 8
94 # error "This library assumes 8 bit byte sizes."
95 #endif
96 
97 /* User defined overrides. */
98 #if defined(IQR_UNENFORCED_RETURNS)
99 # define IQR_MUST_CHECK
100 #endif
101 
102 /* Function Decorator Macros */
103 #if defined(__GNUC__) || defined(__clang__)
104 # if defined(_WIN32) || defined(_WIN64)
105 # define IQR_EXPORT __attribute__((dllexport))
106 # define IQR_IMPORT __attribute__((dllimport))
107 # else
108 # define IQR_EXPORT __attribute__((visibility("default")))
109 # define IQR_IMPORT
110 # endif
111 # if !defined(IQR_UNENFORCED_RETURNS)
112 # define IQR_MUST_CHECK __attribute__((warn_unused_result))
113 # endif
114 # define IQR_DEPRECATED __attribute__((deprecated))
115 # define IQR_DEPRECATED_MSG(msg) __attribute__((deprecated(msg)))
116 #elif defined(_MSC_VER)
117 # define IQR_EXPORT __declspec(dllexport)
118 # define IQR_IMPORT __declspec(dllimport)
119 # if !defined(IQR_UNENFORCED_RETURNS)
120 # define IQR_MUST_CHECK _Check_return_
121 # endif
122 # define IQR_DEPRECATED __declspec(deprecated)
123 # define IQR_DEPRECATED_MSG(msg) __declspec(deprecated(msg))
124 #elif defined(CPPCHECK)
125 # define IQR_EXPORT
126 # define IQR_IMPORT
127 # define IQR_MUST_CHECK
128 # define IQR_DEPRECATED
129 # define IQR_DEPRECATED_MSG(msg)
130 #else
131 # error "Unsupported compiler suite!"
132 #endif
133 
134 /* API */
135 #if defined(IQR_ISARA_BUILD)
136 # define IQR_API IQR_EXPORT IQR_MUST_CHECK
137 # define IQR_API_UNENFORCED_RETURN IQR_EXPORT
138 # define IQR_EXTERN IQR_EXPORT extern
139 #else
140 # if defined(_MSC_VER) && defined(IQR_DLL)
141 # define IQR_API IQR_IMPORT IQR_MUST_CHECK
142 # define IQR_API_UNENFORCED_RETURN IQR_IMPORT
143 # define IQR_EXTERN IQR_IMPORT extern
144 # else
145 # define IQR_API IQR_MUST_CHECK
146 # define IQR_API_UNENFORCED_RETURN
147 # define IQR_EXTERN extern
148 # endif
149 #endif
150 
153 #endif /* IQR_API_H */