Prechádzať zdrojové kódy

add 64 bit signed integer

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@72230 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 7 rokov pred
rodič
commit
ccaec74eb7
4 zmenil súbory, kde vykonal 632 pridanie a 575 odobranie
  1. 603 574
      configure
  2. 8 0
      configure.in
  3. 4 1
      include/config.h.in
  4. 17 0
      include/gis.h

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 603 - 574
configure


+ 8 - 0
configure.in

@@ -489,6 +489,14 @@ AC_DEFINE(HAVE_LONG_LONG_INT)
 AC_MSG_RESULT(no)
 ])
 
+AC_MSG_CHECKING(for int64_t)
+AC_TRY_COMPILE([#include <sys/types.h>],[int64_t x;],[
+AC_MSG_RESULT(yes)
+AC_DEFINE(HAVE_INT64_T)
+],[
+AC_MSG_RESULT(no)
+])
+
 AC_MSG_CHECKING(for W11)
 case "$enable_w11" in
 	yes|no)	AC_MSG_RESULT("$enable_w11")	;;

+ 4 - 1
include/config.h.in

@@ -89,9 +89,12 @@
 /* define uid_t type */
 #undef uid_t
 
-/* define if "long long" is available */
+/* define if "long long int" is available */
 #undef HAVE_LONG_LONG_INT
 
+/* define if "int64_t" is available */
+#undef HAVE_INT64_T
+
 /* Define the return type of signal handlers */
 #define RETSIGTYPE int
 

+ 17 - 0
include/gis.h

@@ -581,6 +581,23 @@ typedef int CELL;
 typedef double DCELL;
 typedef float FCELL;
 
+/* 64 bit signed integer */
+#ifdef __MINGW32__
+typedef __int64 grass_int64;
+#elif HAVE_INT64_T
+#include <sys/types.h>
+typedef int64_t grass_int64;
+#elif HAVE_LONG_LONG_INT
+typedef long long int grass_int64;
+#elif HAVE_LARGEFILES
+typedef off_t grass_int64;
+#else
+#error "no 64 bit integer available"
+#endif
+
+/* LCELL = large CELL, proposed new raster data type */
+typedef grass_int64 LCELL;
+
 struct _Color_Value_
 {
     DCELL value;