diff options
author | Brad King <brad.king@kitware.com> | 2006-08-25 19:53:03 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-08-25 19:53:03 (GMT) |
commit | 6c75c03143bb4ffed2dd192591adab89bde5b8b0 (patch) | |
tree | e3e3669a5e8485369348e8208d8e9ba053f5bd31 | |
parent | 3e572c936c90f7c3a56b3b1fcb98a2b445564f8b (diff) | |
download | CMake-6c75c03143bb4ffed2dd192591adab89bde5b8b0.zip CMake-6c75c03143bb4ffed2dd192591adab89bde5b8b0.tar.gz CMake-6c75c03143bb4ffed2dd192591adab89bde5b8b0.tar.bz2 |
ENH: Switching KWSYS_CHAR_IS_SIGNED test to use KWSYS_PLATFORM_CXX_TEST_RUN macro.
-rw-r--r-- | Source/kwsys/CMakeLists.txt | 20 | ||||
-rw-r--r-- | Source/kwsys/kwsysPlatformCxxTests.cxx | 4 |
2 files changed, 4 insertions, 20 deletions
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index 503c8d6..291a7af 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -437,24 +437,8 @@ IF(KWSYS_USE_FundamentalType) ENDIF(KWSYS_USE___INT64) # Check signedness of "char" type. - IF("KWSYS_CHAR_IS_SIGNED" MATCHES "^KWSYS_CHAR_IS_SIGNED$") - MESSAGE(STATUS "Checking signedness of char") - TRY_RUN(KWSYS_CHAR_IS_SIGNED KWSYS_CHAR_IS_SIGNED_COMPILED - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/kwsysPlatformCxxTests.cxx - COMPILE_DEFINITIONS -DTEST_KWSYS_CHAR_IS_SIGNED) - IF(KWSYS_CHAR_IS_SIGNED_COMPILED) - IF(KWSYS_CHAR_IS_SIGNED) - MESSAGE(STATUS "Checking signedness of char -- signed") - SET(KWSYS_CHAR_IS_SIGNED 1 CACHE INTERNAL "Whether char is signed.") - ELSE(KWSYS_CHAR_IS_SIGNED) - MESSAGE(STATUS "Checking signedness of char -- unsigned") - SET(KWSYS_CHAR_IS_SIGNED 0 CACHE INTERNAL "Whether char is signed.") - ENDIF(KWSYS_CHAR_IS_SIGNED) - ELSE(KWSYS_CHAR_IS_SIGNED_COMPILED) - MESSAGE(FATAL_ERROR "Checking signedness of char -- failed") - ENDIF(KWSYS_CHAR_IS_SIGNED_COMPILED) - ENDIF("KWSYS_CHAR_IS_SIGNED" MATCHES "^KWSYS_CHAR_IS_SIGNED$") + KWSYS_PLATFORM_CXX_TEST_RUN(KWSYS_CHAR_IS_SIGNED + "Checking whether char is signed" DIRECT) ENDIF(KWSYS_USE_FundamentalType) IF(KWSYS_NAMESPACE MATCHES "^kwsys$") diff --git a/Source/kwsys/kwsysPlatformCxxTests.cxx b/Source/kwsys/kwsysPlatformCxxTests.cxx index e921676..8048acf 100644 --- a/Source/kwsys/kwsysPlatformCxxTests.cxx +++ b/Source/kwsys/kwsysPlatformCxxTests.cxx @@ -267,11 +267,11 @@ int main() #endif #ifdef TEST_KWSYS_CHAR_IS_SIGNED -/* Return 1 for char signed and 0 for char unsigned. */ +/* Return 0 for char signed and 1 for char unsigned. */ int main() { unsigned char uc = 255; - return (*reinterpret_cast<char*>(&uc) < 0)?1:0; + return (*reinterpret_cast<char*>(&uc) < 0)?0:1; } #endif |