BoolC.h (1565B)
1 /** @file 2 @brief Header providing a C-safe "bool" type, because we can't depend on 3 Visual Studio providing proper C99 support in external-facing APIs. 4 5 Must be c-safe! 6 7 @date 2015 8 9 @author 10 Sensics, Inc. 11 <http://sensics.com/osvr> 12 */ 13 14 /* 15 // Copyright 2015 Sensics, Inc. 16 // 17 // Licensed under the Apache License, Version 2.0 (the "License"); 18 // you may not use this file except in compliance with the License. 19 // You may obtain a copy of the License at 20 // 21 // http://www.apache.org/licenses/LICENSE-2.0 22 // 23 // Unless required by applicable law or agreed to in writing, software 24 // distributed under the License is distributed on an "AS IS" BASIS, 25 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 // See the License for the specific language governing permissions and 27 // limitations under the License. 28 */ 29 30 #ifndef INCLUDED_BoolC_h_GUID_4F97BE90_2758_4BA5_B0FC_0CA92DEBA210 31 #define INCLUDED_BoolC_h_GUID_4F97BE90_2758_4BA5_B0FC_0CA92DEBA210 32 33 /* Internal Includes */ 34 #include <osvr/Util/APIBaseC.h> 35 #include <osvr/Util/StdInt.h> 36 37 /* Library/third-party includes */ 38 /* none */ 39 40 /* Standard includes */ 41 /* none */ 42 43 OSVR_EXTERN_C_BEGIN 44 /** @addtogroup Util 45 @{ 46 */ 47 48 /** @brief A pre-C99-safe bool type. Canonical values for true and false are 49 * provided. Interpretation of other values is not defined. */ 50 typedef uint8_t OSVR_CBool; 51 /** @brief Canonical "true" value for OSVR_CBool */ 52 #define OSVR_TRUE (1) 53 /** @brief Canonical "false" value for OSVR_CBool */ 54 #define OSVR_FALSE (0) 55 56 /** @} */ 57 OSVR_EXTERN_C_END 58 59 #endif