comparison configure.ac @ 16313:6aafe87a3144

use int64_t for idx type if --enable-64 * configure.ac: Check for and use int64_t instead of long if --enable-64. (IDX_TYPE_LONG): Delete definion. Change all uses to check USE_64_BIT_IDX_T instead. * MArray-i.cc: Instantiate arrays of int64_t instead of long, but only if USE_64_BIT_IDX_T is defined. * acinclinde.m4 (OCTAVE_CHECK_SIZEOF_FORTRAN_INTEGER): Use int64_t instead of long.
author John W. Eaton <jwe@octave.org>
date Fri, 15 Mar 2013 07:07:08 -0400
parents 00da706fba48
children eb572251b7c6
comparison
equal deleted inserted replaced
16311:9c4ac8f25a8c 16313:6aafe87a3144
241 [if test "$enableval" = yes; then USE_64_BIT_IDX_T=yes; fi], []) 241 [if test "$enableval" = yes; then USE_64_BIT_IDX_T=yes; fi], [])
242 if test $USE_64_BIT_IDX_T = yes; then 242 if test $USE_64_BIT_IDX_T = yes; then
243 AC_CHECK_SIZEOF([void *]) 243 AC_CHECK_SIZEOF([void *])
244 AC_CHECK_SIZEOF([int]) 244 AC_CHECK_SIZEOF([int])
245 AC_CHECK_SIZEOF([long]) 245 AC_CHECK_SIZEOF([long])
246 AC_CHECK_SIZEOF([int64_t])
246 if test $ac_cv_sizeof_void_p -eq 8; then 247 if test $ac_cv_sizeof_void_p -eq 8; then
247 if test $ac_cv_sizeof_int -eq 8; then 248 OCTAVE_IDX_TYPE=int64_t
248 OCTAVE_IDX_TYPE=int
249 elif test $ac_cv_sizeof_long -eq 8; then
250 OCTAVE_IDX_TYPE=long
251 AC_DEFINE(IDX_TYPE_LONG, 1, [Define to 1 if octave index type is long.])
252 else
253 warn_64_bit="no suitable type found for octave_idx_type so disabling 64-bit features"
254 OCTAVE_CONFIGURE_WARNING([warn_64_bit])
255 USE_64_BIT_IDX_T=no
256 fi
257 else 249 else
258 warn_64_bit="pointers are not 64-bits wide; disabling 64-bit features" 250 warn_64_bit="pointers are not 64-bits wide; disabling 64-bit features"
259 OCTAVE_CONFIGURE_WARNING([warn_64_bit]) 251 OCTAVE_CONFIGURE_WARNING([warn_64_bit])
260 USE_64_BIT_IDX_T=no 252 USE_64_BIT_IDX_T=no
261 fi 253 fi
2747 #if 0 2739 #if 0
2748 #define F77_USES_VISUAL_FORTRAN_CALLING_CONVENTION 2740 #define F77_USES_VISUAL_FORTRAN_CALLING_CONVENTION
2749 #endif 2741 #endif
2750 2742
2751 #ifdef USE_64_BIT_IDX_T 2743 #ifdef USE_64_BIT_IDX_T
2752 #define SIZEOF_OCTAVE_IDX_TYPE 8 2744 #define SIZEOF_OCTAVE_IDX_TYPE SIZEOF_INT64_T
2753 #else 2745 #else
2754 #define SIZEOF_OCTAVE_IDX_TYPE SIZEOF_INT 2746 #define SIZEOF_OCTAVE_IDX_TYPE SIZEOF_INT
2755 #endif 2747 #endif
2756 2748
2757 /* To be able to use long doubles for 64-bit mixed arithmetics, we need 2749 /* To be able to use long doubles for 64-bit mixed arithmetics, we need
2820 #define OCTGUI_API OCTAVE_IMPORT 2812 #define OCTGUI_API OCTAVE_IMPORT
2821 #endif 2813 #endif
2822 2814
2823 /* oct-types.h */ 2815 /* oct-types.h */
2824 2816
2817 #include <stdint.h>
2818
2825 typedef OCTAVE_IDX_TYPE octave_idx_type; 2819 typedef OCTAVE_IDX_TYPE octave_idx_type;
2826
2827 #include <stdint.h>
2828 2820
2829 /* Tag indicating Octave config.h has been included */ 2821 /* Tag indicating Octave config.h has been included */
2830 #define OCTAVE_CONFIG_INCLUDED 1 2822 #define OCTAVE_CONFIG_INCLUDED 1
2831 ]) 2823 ])
2832 2824