mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Revert "Fix for OS X 10.5 compile error wrt llabs()"
This reverts commit 3f6aa735e9
.
Using abs() does not work if the integer is >2^32 (or <2^32).
Will add a new fix in next commit.
This commit is contained in:
parent
2f7fa3470b
commit
104c7da205
3 changed files with 1 additions and 33 deletions
|
@ -1,6 +1,3 @@
|
||||||
include(CheckCSourceCompiles)
|
|
||||||
include(CheckCXXSourceCompiles)
|
|
||||||
|
|
||||||
if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||||
# alternate malloc is faster for FreeBSD, but needs more testing
|
# alternate malloc is faster for FreeBSD, but needs more testing
|
||||||
# need to add way to set this from the command line
|
# 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)
|
set(USE_NMALLOC true)
|
||||||
|
|
||||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
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 <math.h>
|
|
||||||
#include <cstdlib>
|
|
||||||
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")
|
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||||
set(HAVE_LINUX true)
|
set(HAVE_LINUX true)
|
||||||
|
@ -50,7 +25,7 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "irix")
|
||||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "ultrix")
|
elseif (${CMAKE_SYSTEM_NAME} MATCHES "ultrix")
|
||||||
list(APPEND CMAKE_C_FLAGS -std1 -g3)
|
list(APPEND CMAKE_C_FLAGS -std1 -g3)
|
||||||
list(APPEND CMAKE_CXX_FLAGS -std1 -g3)
|
list(APPEND CMAKE_CXX_FLAGS -std1 -g3)
|
||||||
|
include(CheckCSourceCompiles)
|
||||||
check_c_source_compiles("
|
check_c_source_compiles("
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
int main() {
|
int main() {
|
||||||
|
|
|
@ -146,6 +146,3 @@
|
||||||
|
|
||||||
/* Define u_int8_t */
|
/* Define u_int8_t */
|
||||||
#define u_int8_t @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
|
|
||||||
|
|
|
@ -515,11 +515,7 @@ Val* Val::SizeVal() const
|
||||||
{
|
{
|
||||||
switch ( type->InternalType() ) {
|
switch ( type->InternalType() ) {
|
||||||
case TYPE_INTERNAL_INT:
|
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);
|
return new Val(llabs(val.int_val), TYPE_COUNT);
|
||||||
#endif
|
|
||||||
|
|
||||||
case TYPE_INTERNAL_UNSIGNED:
|
case TYPE_INTERNAL_UNSIGNED:
|
||||||
return new Val(val.uint_val, TYPE_COUNT);
|
return new Val(val.uint_val, TYPE_COUNT);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue