| 264 */ |
264 */ |
| 265 #define cx_attr_nodiscard __attribute__((__warn_unused_result__)) |
265 #define cx_attr_nodiscard __attribute__((__warn_unused_result__)) |
| 266 |
266 |
| 267 #endif // __STDC_VERSION__ |
267 #endif // __STDC_VERSION__ |
| 268 |
268 |
| |
269 |
| |
270 // --------------------------------------------------------------------------- |
| |
271 // MSVC specifics |
| |
272 // --------------------------------------------------------------------------- |
| |
273 |
| |
274 #ifdef _MSC_VER |
| |
275 // fix missing _Thread_local support |
| |
276 #define _Thread_local __declspec(thread) |
| |
277 #endif // _MSC_VER |
| |
278 |
| |
279 #if defined(CX_WINDLL_EXPORT) |
| |
280 #define cx_attr_export __declspec(dllexport) |
| |
281 #elif defined(CX_WINDLL) |
| |
282 #define cx_attr_export __declspec(dllimport) |
| |
283 #else |
| |
284 #define cx_attr_export |
| |
285 #endif // CX_WINDLL / CX_WINDLL_EXPORT |
| |
286 |
| 269 // --------------------------------------------------------------------------- |
287 // --------------------------------------------------------------------------- |
| 270 // Useful function pointers |
288 // Useful function pointers |
| 271 // --------------------------------------------------------------------------- |
289 // --------------------------------------------------------------------------- |
| 272 |
290 |
| 273 /** |
291 /** |
| 338 * @retval non-zero the multiplication would overflow |
356 * @retval non-zero the multiplication would overflow |
| 339 */ |
357 */ |
| 340 #if __cplusplus |
358 #if __cplusplus |
| 341 extern "C" |
359 extern "C" |
| 342 #endif |
360 #endif |
| 343 int cx_szmul_impl(size_t a, size_t b, size_t *result); |
361 cx_attr_export int cx_szmul_impl(size_t a, size_t b, size_t *result); |
| 344 #endif // cx_szmul |
362 #endif // cx_szmul |
| 345 |
363 |
| 346 |
364 |
| 347 // --------------------------------------------------------------------------- |
|
| 348 // Fixes for MSVC incompatibilities |
|
| 349 // --------------------------------------------------------------------------- |
|
| 350 |
|
| 351 #ifdef _MSC_VER |
|
| 352 // fix missing _Thread_local support |
|
| 353 #define _Thread_local __declspec(thread) |
|
| 354 #endif // _MSC_VER |
|
| 355 |
365 |
| 356 #endif // UCX_COMMON_H |
366 #endif // UCX_COMMON_H |