[Lemon-commits] Alpar Juttner: Add long long checking to build s...
Lemon HG
hg at lemon.cs.elte.hu
Fri Feb 20 23:02:43 CET 2009
details: http://lemon.cs.elte.hu/hg/lemon/rev/7992dcb0d0e6
changeset: 526:7992dcb0d0e6
user: Alpar Juttner <alpar [at] cs.elte.hu>
date: Fri Feb 20 18:06:10 2009 +0000
description:
Add long long checking to build systems (#230)
diffstat:
6 files changed, 17 insertions(+), 2 deletions(-)
CMakeLists.txt | 3 +++
configure.ac | 8 ++++++++
lemon/bits/default_map.h | 2 +-
lemon/config.h.cmake | 1 +
lemon/config.h.in | 3 +++
lemon/tolerance.h | 2 +-
diffs (79 lines):
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 <typename _Graph, typename _Item>
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.
More information about the Lemon-commits
mailing list