Don't keep a special case for Windows as it's wrong. The problem is that
the BOOL type predefined on Windows in C does not match the C++ bool type for the same compiler. One is an int when the other is a char. Make sure we check for bool for all non C++ compilers. This commit was SVN r11429.
Этот коммит содержится в:
родитель
c1a77b921d
Коммит
522cae342b
@ -123,17 +123,13 @@
|
||||
* constants. OMPI_NEED_C_BOOL will be true if the compiler either
|
||||
* needs <stdbool.h> or doesn't define the bool type at all.
|
||||
*/
|
||||
#if !defined(__cplusplus)
|
||||
#if !(defined(c_plusplus) || defined(__cplusplus))
|
||||
# if OMPI_NEED_C_BOOL
|
||||
# if OMPI_USE_STDBOOL_H
|
||||
/* If we're using <stdbool.h>, there is an implicit
|
||||
assumption that the C++ bool is the same size and has
|
||||
the same alignment. */
|
||||
# include <stdbool.h>
|
||||
# elif defined(__WINDOWS__)
|
||||
# define bool BOOL
|
||||
# define false FALSE
|
||||
# define true TRUE
|
||||
# else
|
||||
/* We need to create a bool type and ensure that it's the
|
||||
same size / alignment as the C++ bool size /
|
||||
@ -141,7 +137,7 @@
|
||||
# define false 0
|
||||
# define true 1
|
||||
# if SIZEOF_BOOL == SIZEOF_CHAR && OMPI_ALIGNMENT_CXX_BOOL == OMPI_ALIGNMENT_CHAR
|
||||
typedef char bool;
|
||||
typedef unsigned char bool;
|
||||
# elif SIZEOF_BOOL == SIZEOF_SHORT && OMPI_ALIGNMENT_CXX_BOOL == OMPI_ALIGNMENT_SHORT
|
||||
typedef short bool;
|
||||
# elif SIZEOF_BOOL == SIZEOF_INT && OMPI_ALIGNMENT_CXX_BOOL == OMPI_ALIGNMENT_INT
|
||||
@ -153,8 +149,8 @@ typedef long long bool;
|
||||
# else
|
||||
# error Cannot find a C type that corresponds to the size and alignment of C++ bool!
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# endif /* OMPI_USE_STDBOOL_H */
|
||||
# endif /* OMPI_NEED_C_BOOL */
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user