Cleanup: stdbool no longer optional, remove checks
This commit is contained in:
@@ -726,11 +726,6 @@ else()
|
|||||||
set(COMPILER_SSE2_FLAG)
|
set(COMPILER_SSE2_FLAG)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
TEST_STDBOOL_SUPPORT()
|
|
||||||
if(HAVE_STDBOOL_H)
|
|
||||||
add_definitions(-DHAVE_STDBOOL_H)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
TEST_SHARED_PTR_SUPPORT()
|
TEST_SHARED_PTR_SUPPORT()
|
||||||
TEST_UNORDERED_MAP_SUPPORT()
|
TEST_UNORDERED_MAP_SUPPORT()
|
||||||
|
|
||||||
@@ -3051,9 +3046,6 @@ if(FIRST_RUN)
|
|||||||
info_cfg_option(WITH_GL_ANGLE)
|
info_cfg_option(WITH_GL_ANGLE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# debug
|
|
||||||
message(STATUS "HAVE_STDBOOL_H = ${HAVE_STDBOOL_H}")
|
|
||||||
|
|
||||||
info_cfg_text("")
|
info_cfg_text("")
|
||||||
|
|
||||||
message("${_config_msg}")
|
message("${_config_msg}")
|
||||||
|
@@ -799,17 +799,6 @@ macro(TEST_SSE_SUPPORT
|
|||||||
unset(CMAKE_REQUIRED_FLAGS)
|
unset(CMAKE_REQUIRED_FLAGS)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(TEST_STDBOOL_SUPPORT)
|
|
||||||
include(CheckCSourceRuns)
|
|
||||||
|
|
||||||
# This program will compile correctly if and only if
|
|
||||||
# this C compiler supports C99 stdbool.
|
|
||||||
check_c_source_runs("
|
|
||||||
#include <stdbool.h>
|
|
||||||
int main(void) { return (int)false; }"
|
|
||||||
HAVE_STDBOOL_H)
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
# Only print message if running CMake first time
|
# Only print message if running CMake first time
|
||||||
macro(message_first_run)
|
macro(message_first_run)
|
||||||
if(FIRST_RUN)
|
if(FIRST_RUN)
|
||||||
|
@@ -78,25 +78,7 @@ typedef uint64_t u_int64_t;
|
|||||||
#endif /* ifdef platform for types */
|
#endif /* ifdef platform for types */
|
||||||
|
|
||||||
#include <stddef.h> /* size_t define */
|
#include <stddef.h> /* size_t define */
|
||||||
|
#include <stdbool.h>
|
||||||
#ifdef HAVE_STDBOOL_H
|
|
||||||
# include <stdbool.h>
|
|
||||||
#elif !defined(__bool_true_false_are_defined) && !defined(__BOOL_DEFINED)
|
|
||||||
# ifndef HAVE__BOOL
|
|
||||||
# ifdef __cplusplus
|
|
||||||
typedef bool _BLI_Bool;
|
|
||||||
# else
|
|
||||||
/* Make sure bool is alays defined with the same size for both C and C++ */
|
|
||||||
# define _BLI_Bool unsigned char
|
|
||||||
# endif
|
|
||||||
# else
|
|
||||||
# define _BLI_Bool _Bool
|
|
||||||
# endif
|
|
||||||
# define bool _BLI_Bool
|
|
||||||
# define false 0
|
|
||||||
# define true 1
|
|
||||||
# define __bool_true_false_are_defined 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user