Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
4781c75f
Commit
4781c75f
authored
Mar 17, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new `CAF_COMPILER_VERSION` convenience macro
parent
6ffdb814
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
3 deletions
+34
-3
libcaf_core/caf/config.hpp
libcaf_core/caf/config.hpp
+34
-3
No files found.
libcaf_core/caf/config.hpp
View file @
4781c75f
...
...
@@ -30,16 +30,37 @@
// to complete traces (4)
/**
* Denotes
the libcaf version
in the format {MAJOR}{MINOR}{PATCH},
* Denotes
version of CAF
in the format {MAJOR}{MINOR}{PATCH},
* whereas each number is a two-digit decimal number without
* leading zeros (e.g. 900 is version 0.9.0).
*/
#define CAF_VERSION 1300
/**
* Defined to the major version number of CAF.
**/
#define CAF_MAJOR_VERSION (CAF_VERSION / 10000)
/**
* Defined to the minor version number of CAF.
**/
#define CAF_MINOR_VERSION ((CAF_VERSION / 100) % 100)
/**
* Defined to the patch version number of CAF.
**/
#define CAF_PATCH_VERSION (CAF_VERSION % 100)
// This compiler-specific block defines:
// - CAF_DEPRECATED to annotate deprecated functions
// - CAF_PUSH_WARNINGS/CAF_POP_WARNINGS to surround "noisy" header includes
// - CAF_ANNOTATE_FALLTHROUGH to suppress warnings in switch/case statements
// - CAF_COMPILER_VERSION to retrieve the compiler version in CAF_VERSION format
// - One of the following:
// + CAF_CLANG
// + CAF_GCC
// + CAF_MSVC
// sets CAF_DEPRECATED, CAF_ANNOTATE_FALLTHROUGH,
// CAF_PUSH_WARNINGS and CAF_POP_WARNINGS
#if defined(__clang__)
...
...
@@ -76,18 +97,23 @@
# define CAF_POP_WARNINGS \
_Pragma("clang diagnostic pop")
# define CAF_ANNOTATE_FALLTHROUGH [[clang::fallthrough]]
# define CAF_COMPILER_VERSION \
(__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
#elif defined(__GNUC__)
# define CAF_GCC
# define CAF_DEPRECATED __attribute__((__deprecated__))
# define CAF_PUSH_WARNINGS
# define CAF_POP_WARNINGS
# define CAF_ANNOTATE_FALLTHROUGH static_cast<void>(0)
# define CAF_COMPILER_VERSION \
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
#elif defined(_MSC_VER)
# define CAF_MSVC
# define CAF_DEPRECATED
# define CAF_PUSH_WARNINGS
# define CAF_POP_WARNINGS
# define CAF_ANNOTATE_FALLTHROUGH static_cast<void>(0)
# define CAF_COMPILER_VERSION _MSC_FULL_VER
#else
# define CAF_DEPRECATED
# define CAF_PUSH_WARNINGS
...
...
@@ -95,7 +121,12 @@
# define CAF_ANNOTATE_FALLTHROUGH static_cast<void>(0)
#endif
// detect OS
// This OS-specific block defines one of the following:
// - CAF_MACOS
// - CAF_LINUX
// - CAF_BSD
// - CAF_WINDOWS
// It also defines CAF_POSIX for POSIX-compatible systems
#if defined(__APPLE__)
# define CAF_MACOS
# ifndef _GLIBCXX_HAS_GTHREADS
...
...
@@ -121,7 +152,7 @@
#include <cstdio>
#include <cstdlib>
//
import backtrace and backtrace_symbols_fd into caf::detail
//
Optionally enable CAF_ASSERT
#ifndef CAF_ENABLE_RUNTIME_CHECKS
# define CAF_ASSERT(unused) static_cast<void>(0)
#elif defined(CAF_WINDOWS) || defined(CAF_BSD)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment