diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,9 @@ INCLUDE(FindDoxygen) INCLUDE(FindGhostscript) +INCLUDE(CheckTypeSize) +CHECK_TYPE_SIZE("long long" LONG_LONG) + ENABLE_TESTING() ADD_SUBDIRECTORY(lemon) diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -24,6 +24,12 @@ dnl Do compilation tests using the C++ compiler. AC_LANG([C++]) +dnl Check the existence of long long type. +AC_CHECK_TYPE(long long, [long_long_found=yes], [long_long_found=no]) +if test x"$long_long_found" = x"yes"; then + AC_DEFINE([HAVE_LONG_LONG], [1], [Define to 1 if you have long long.]) +fi + dnl Checks for programs. AC_PROG_CXX AC_PROG_CXXCPP @@ -116,6 +122,8 @@ echo C++ compiler.................. : $CXX echo C++ compiles flags............ : $CXXFLAGS echo +echo Compiler supports long long... : $long_long_found +echo #echo GLPK support.................. : $lx_glpk_found #echo CPLEX support................. : $lx_cplex_found #echo SOPLEX support................ : $lx_soplex_found diff --git a/lemon/bits/default_map.h b/lemon/bits/default_map.h --- a/lemon/bits/default_map.h +++ b/lemon/bits/default_map.h @@ -96,7 +96,7 @@ }; -#if defined __GNUC__ && !defined __STRICT_ANSI__ +#if defined HAVE_LONG_LONG // long long template diff --git a/lemon/config.h.cmake b/lemon/config.h.cmake new file mode 100644 --- /dev/null +++ b/lemon/config.h.cmake @@ -0,0 +1,1 @@ +#cmakedefine HAVE_LONG_LONG 1 \ No newline at end of file diff --git a/lemon/config.h.in b/lemon/config.h.in --- a/lemon/config.h.in +++ b/lemon/config.h.in @@ -3,3 +3,6 @@ /* Define to 1 if you have GLPK. */ #undef HAVE_GLPK + +/* Define to 1 if you have long long */ +#undef HAVE_LONG_LONG diff --git a/lemon/tolerance.h b/lemon/tolerance.h --- a/lemon/tolerance.h +++ b/lemon/tolerance.h @@ -371,7 +371,7 @@ static Value zero() {return 0;} }; -#if defined __GNUC__ && !defined __STRICT_ANSI__ +#if HAVE_LONG_LONG ///Long long integer specialization of Tolerance.