tlx
Loading...
Searching...
No Matches
attribute_fallthrough.hpp
Go to the documentation of this file.
1/*******************************************************************************
2 * tlx/define/attribute_fallthrough.hpp
3 *
4 * Part of tlx - http://panthema.net/tlx
5 *
6 * Copyright (C) 2015-2017 Timo Bingmann <tb@panthema.net>
7 *
8 * All rights reserved. Published under the Boost Software License, Version 1.0
9 ******************************************************************************/
10
11#ifndef TLX_DEFINE_ATTRIBUTE_FALLTHROUGH_HEADER
12#define TLX_DEFINE_ATTRIBUTE_FALLTHROUGH_HEADER
13
14namespace tlx {
15
16//! \addtogroup tlx_define
17//! \{
18
19/******************************************************************************/
20// __attribute__ ((fallthrough))
21
22#if defined(__GNUC__) && __GNUC__ >= 7
23#define TLX_ATTRIBUTE_FALLTHROUGH __attribute__ ((fallthrough))
24#elif defined(__clang__)
25#define TLX_ATTRIBUTE_FALLTHROUGH [[clang::fallthrough]]
26#else
27#define TLX_ATTRIBUTE_FALLTHROUGH
28#endif
29
30//! \}
31
32} // namespace tlx
33
34#endif // !TLX_DEFINE_ATTRIBUTE_FALLTHROUGH_HEADER
35
36/******************************************************************************/