From 3831233301deee60f599eb19a76700dc08c5daf5 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Fri, 18 Jun 2021 10:15:23 +0200 Subject: [PATCH] Added stdbool.h compat header --- compat/stdbool/stdbool.h | 22 ++++++++++++++++++++++ rdtk/CMakeLists.txt | 9 +++++++++ 2 files changed, 31 insertions(+) create mode 100644 compat/stdbool/stdbool.h diff --git a/compat/stdbool/stdbool.h b/compat/stdbool/stdbool.h new file mode 100644 index 000000000..331a4492f --- /dev/null +++ b/compat/stdbool/stdbool.h @@ -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 */ diff --git a/rdtk/CMakeLists.txt b/rdtk/CMakeLists.txt index 764a545c2..dce2ec612 100644 --- a/rdtk/CMakeLists.txt +++ b/rdtk/CMakeLists.txt @@ -49,6 +49,15 @@ if(NOT DEFINED BUILD_SHARED_LIBS) set(BUILD_SHARED_LIBS ON) 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") include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)