summaryrefslogtreecommitdiffhomepage
path: root/include/ocl/detail/config.hpp
blob: 9df85971f40688a3481087c83b53e352255c4452 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
 * File: detail/config.hpp
 * Purpose: Config file of the OCL.CORE library.
 * Author: Amlal El Mahrouss (amlal@nekernel.org)
 * Copyright 2025, Amlal El Mahrouss, licensed under the Boost Software License.
 */

#ifndef __OCL_CORE_CONFIG
#define __OCL_CORE_CONFIG

#ifndef __OCL_FREESTANDING
#include <boost/config.hpp>
#include <boost/core/addressof.hpp>
#include <boost/core/nvp.hpp>
#include <boost/core/demangle.hpp>
#include <boost/core/null_deleter.hpp>
#include <boost/container/allocator.hpp>
#include <boost/assert/source_location.hpp>
#include <boost/assert.hpp>
#include <boost/utility/string_view.hpp>
#endif

#define OCL_DEPRECATED()		[[deprecated]]
#define OCL_DEPRECATED_MSG(MSG) [[deprecated(MSG)]]

#if 202002L > __cplusplus
#error !! OCL.Core works with C++20 and greater !!
#endif

#ifdef __cplusplus
#define OCL_DECL extern "C"
/// DLL/Dylib/So specific macro.
#ifdef __GNUC__
#define OCL_EXPORT_DECL OCL_DECL __attribute__((visibility("default")))
#else
#define OCL_EXPORT_DECL OCL_DECL declspec(dllexport)
#endif
#else
#define OCL_DECL
#ifdef __GNUC__
#define OCL_EXPORT_DECL
#else
#define OCL_EXPORT_DECL OCL_DECL declspec(dllimport)
#endif
#endif

#ifdef _WIN32
#define OCL_USE_CRLF_ENDINGS 1
#define OCL_WINDOWS			 1
#endif

#if OCL_WANTS_PRAGMA_ONCE
#define OCL_HAS_PRAGMA_ONCE 1
#endif

namespace ocl
{

	namespace detail
	{

		inline void throw_runtime_error(const boost::source_location& loc = BOOST_CURRENT_LOCATION)
		{
			throw std::runtime_error(loc.to_string());
		}

	} // namespace detail

} // namespace ocl

#endif