Patch for enabling blockwise and bt
[platform/upstream/iotivity.git] / resource / c_common / platform_features.h
1 //******************************************************************
2 //
3 // Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 //      http://www.apache.org/licenses/LICENSE-2.0
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19 //******************************************************************
20
21 /**
22  * @file
23  *
24  * This file contains compiler and platform feature definitions.  These
25  * can be used to enable functionality on only platforms that support
26  * said functionality.
27  */
28
29 #ifndef PLATFORM_FEATURES_H_
30 #define PLATFORM_FEATURES_H_
31
32
33 #if (__cplusplus >=201103L) || defined(__GXX_EXPERIMENTAL_CXX0X__)
34     #define SUPPORTS_DEFAULT_CTOR
35 #endif
36
37 #if (__STDC_VERSION__ >= 201112L)
38     #include <stdassert.h>
39     #define OC_STATIC_ASSERT(condition, msg) static_assert(condition, msg)
40 #else
41     #define OC_STATIC_ASSERT(condition, msg) ((void)sizeof(char[2*!!(condition) - 1]))
42 #endif
43
44 #endif