Skip to content

Commit

Permalink
Added stdbool.h compat header
Browse files Browse the repository at this point in the history
  • Loading branch information
akallabeth committed Jun 18, 2021
1 parent 0b0b716 commit 3831233
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
22 changes: 22 additions & 0 deletions compat/stdbool/stdbool.h
Original file line number Diff line number Diff line change
@@ -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 */
9 changes: 9 additions & 0 deletions rdtk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3831233

Please sign in to comment.