From 104c7da205189fd060e5c63a0cacb574ea39a32b Mon Sep 17 00:00:00 2001 From: Gregor Maier Date: Wed, 9 Feb 2011 15:40:36 -0800 Subject: [PATCH] Revert "Fix for OS X 10.5 compile error wrt llabs()" This reverts commit 3f6aa735e96fcfd91e8fe187b26b74bf2c82bc9d. Using abs() does not work if the integer is >2^32 (or <2^32). Will add a new fix in next commit. --- cmake/OSSpecific.cmake | 27 +-------------------------- config.h.in | 3 --- src/Val.cc | 4 ---- 3 files changed, 1 insertion(+), 33 deletions(-) diff --git a/cmake/OSSpecific.cmake b/cmake/OSSpecific.cmake index b63ce54f6d..03788813c3 100644 --- a/cmake/OSSpecific.cmake +++ b/cmake/OSSpecific.cmake @@ -1,6 +1,3 @@ -include(CheckCSourceCompiles) -include(CheckCXXSourceCompiles) - if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") # alternate malloc is faster for FreeBSD, but needs more testing # need to add way to set this from the command line @@ -10,28 +7,6 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") set(USE_NMALLOC true) elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - # The following may have a greater scope than just Darwin - # (i.e. any platform w/ GCC < 4.1.0), but I've only seen - # it on OS X 10.5, which has GCC 4.0.1, so the workaround - # will be stuck here for now. - # - # See also http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13943 - - check_cxx_source_compiles(" - #include - #include - using namespace std; - int main() { - llabs(1); - return 0; - } - " darwin_llabs_works) - - if (NOT darwin_llabs_works) - # abs() should be used in this case, the long long version should - # exist in the __gnu_cxx namespace - set(DARWIN_NO_LLABS true) - endif () elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(HAVE_LINUX true) @@ -50,7 +25,7 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "irix") elseif (${CMAKE_SYSTEM_NAME} MATCHES "ultrix") list(APPEND CMAKE_C_FLAGS -std1 -g3) list(APPEND CMAKE_CXX_FLAGS -std1 -g3) - + include(CheckCSourceCompiles) check_c_source_compiles(" #include int main() { diff --git a/config.h.in b/config.h.in index 46915563a8..f1405813fc 100644 --- a/config.h.in +++ b/config.h.in @@ -146,6 +146,3 @@ /* Define u_int8_t */ #define u_int8_t @U_INT8_T@ - -/* Whether llabs will be ambiguous in stdlib.h and cstdlib headers */ -#cmakedefine DARWIN_NO_LLABS diff --git a/src/Val.cc b/src/Val.cc index 4519d76f30..4cb9d78023 100644 --- a/src/Val.cc +++ b/src/Val.cc @@ -515,11 +515,7 @@ Val* Val::SizeVal() const { switch ( type->InternalType() ) { case TYPE_INTERNAL_INT: -#ifdef DARWIN_NO_LLABS - return new Val(abs(val.int_val), TYPE_COUNT); -#else return new Val(llabs(val.int_val), TYPE_COUNT); -#endif case TYPE_INTERNAL_UNSIGNED: return new Val(val.uint_val, TYPE_COUNT);