2 * Copyright 2017 Nest Labs Inc. All Rights Reserved.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 * This file defines private macros and interfaces.
22 #ifndef NLIO_PRIVATE_H
23 #define NLIO_PRIVATE_H
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.
31 * Provide an internal convenience macro to do so.
35 * @def __nlIOHasBuiltin
38 * Determines whether or not the compiler in effect has support
39 * for the specified built-in function.
43 #define __nlIOHasBuiltin(...) __has_builtin(__VA_ARGS__)
44 #elif defined __GNUC__
45 #define __nlIOHasBuiltin(...) 1
47 #define __nlIOHasBuiltin(...) 0
48 #endif /* __clang__ */
50 #endif /* NLIO_PRIVATE_H */