sparrow 0.3.0
Loading...
Searching...
No Matches
config.hpp
Go to the documentation of this file.
1// Copyright 2024 Man Group Operations Limited
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#pragma once
16
17#if defined(__apple_build_version__)
18# define COMPILING_WITH_APPLE_CLANG 1
19#else
20# define COMPILING_WITH_APPLE_CLANG 0
21#endif
22
23#if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 170000
24# define USING_LIBCPP_PRE_17 1
25#else
26# define USING_LIBCPP_PRE_17 0
27#endif
28
29#if defined(_WIN32)
30# if defined(SPARROW_STATIC_LIB)
31# define SPARROW_API
32# elif defined(SPARROW_EXPORTS)
33# define SPARROW_API __declspec(dllexport)
34# else
35# define SPARROW_API __declspec(dllimport)
36# endif
37#else
38# define SPARROW_API __attribute__((visibility("default")))
39#endif
40
41[[nodiscard]] consteval bool is_apple_compiler()
42{
43 return static_cast<bool>(COMPILING_WITH_APPLE_CLANG);
44}
consteval bool is_apple_compiler()
Definition config.hpp:41
#define COMPILING_WITH_APPLE_CLANG
Definition config.hpp:20