From 522cae342b855c9353e5892957b916e1914a3d4d Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Fri, 25 Aug 2006 23:16:49 +0000 Subject: [PATCH] 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. --- opal/include/opal_config_bottom.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/opal/include/opal_config_bottom.h b/opal/include/opal_config_bottom.h index d9643d9b24..53e18d9704 100644 --- a/opal/include/opal_config_bottom.h +++ b/opal/include/opal_config_bottom.h @@ -123,17 +123,13 @@ * constants. OMPI_NEED_C_BOOL will be true if the compiler either * needs 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 , there is an implicit assumption that the C++ bool is the same size and has the same alignment. */ # include -# 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 /*