Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / third_party / nlio / repo / include / nlio-private.h
1 /**
2  *    Copyright 2017 Nest Labs Inc. All Rights Reserved.
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16
17 /**
18  *    @file
19  *      This file defines private macros and interfaces.
20  */
21
22 #ifndef NLIO_PRIVATE_H
23 #define NLIO_PRIVATE_H
24
25 /*
26  * If we are compiling under clang, GCC, or any such compatible
27  * compiler, in which -fno-builtins or -ffreestanding might be
28  * asserted, thereby eliminating built-in function optimization, we
29  * may STILL want to leverage built-ins.
30  *
31  * Provide an internal convenience macro to do so.
32  */
33
34 /**
35  *  @def __nlIOHasBuiltin
36  *
37  *  @brief
38  *     Determines whether or not the compiler in effect has support
39  *     for the specified built-in function.
40  *
41  */
42 #ifdef __clang__
43 #define __nlIOHasBuiltin(...) __has_builtin(__VA_ARGS__)
44 #elif defined __GNUC__
45 #define __nlIOHasBuiltin(...) 1
46 #else
47 #define __nlIOHasBuiltin(...) 0
48 #endif /* __clang__ */
49
50 #endif /* NLIO_PRIVATE_H */