| 1 |
/* SPDX-License-Identifier: BSL-1.0 OR BSD-3-Clause */ |
| 2 |
|
| 3 |
#ifndef MPT_DETECT_DL_HPP |
| 4 |
#define MPT_DETECT_DL_HPP |
| 5 |
|
| 6 |
#include "mpt/base/compiletime_warning.hpp" |
| 7 |
|
| 8 |
#if defined(MPT_WITH_DL) |
| 9 |
#if !defined(CPPCHECK) |
| 10 |
#if !__has_include(<dlfcn.h>) |
| 11 |
#error "MPT_WITH_DL defined but <dlfcn.h> not found." |
| 12 |
#endif |
| 13 |
#endif |
| 14 |
#define MPT_DETECTED_DL 1 |
| 15 |
#else |
| 16 |
#if defined(CPPCHECK) |
| 17 |
#define MPT_DETECTED_DL 1 |
| 18 |
#else |
| 19 |
#if __has_include(<dlfcn.h>) |
| 20 |
#define MPT_DETECTED_DL 1 |
| 21 |
#else |
| 22 |
#define MPT_DETECTED_DL 0 |
| 23 |
#endif |
| 24 |
#endif |
| 25 |
#endif |
| 26 |
|
| 27 |
#endif // MPT_DETECT_DL_HPP |