Added stdbool.h compat header

This commit is contained in:
Armin Novak 2021-06-18 10:15:23 +02:00 committed by akallabeth
parent 0b0b716dd6
commit 3831233301
2 changed files with 31 additions and 0 deletions

22
compat/stdbool/stdbool.h Normal file
View File

@ -0,0 +1,22 @@
/*===---- stdbool.h - Standard header for booleans -------------------------===
*
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
* See https://llvm.org/LICENSE.txt for license information.
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
*
*===-----------------------------------------------------------------------===
*/
#ifndef __STDBOOL_H
#define __STDBOOL_H
/* Don't define bool, true, and false in C++, except as a GNU extension. */
#ifndef __cplusplus
typedef int bool;
#define true 1
#define false 0
#endif
#define __bool_true_false_are_defined 1
#endif /* __STDBOOL_H */

View File

@ -49,6 +49,15 @@ if(NOT DEFINED BUILD_SHARED_LIBS)
set(BUILD_SHARED_LIBS ON) set(BUILD_SHARED_LIBS ON)
endif() endif()
if (NOT IOS)
check_include_files(stdbool.h WINPR_HAVE_STDBOOL_H)
if (NOT WINPR_HAVE_STDBOOL_H)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../compat/stdbool)
endif()
else()
set(WINPR_HAVE_STDBOOL_H 1)
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DRDTK_EXPORTS") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DRDTK_EXPORTS")
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)