diff --git a/CHANGES b/CHANGES index c3cac8669..a3c1cf0b4 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,8 @@ CHANGES IN FLTK 1.1.7 - Documentation fixes (STR #571, STR #648, STR #692, STR #730, STR #744, STR #745, STR #931, STR #942, STR #960, STR #969) + - FLTK now enables large file support when available (STR + #1087) - Fl_Clock_Output depended on a time value that was the same as an unsigned long, which is incorrect for WIN64 and VC++ 2005 (STR #1079) diff --git a/configh.in b/configh.in index a2ce28c2d..bb5ae15b6 100644 --- a/configh.in +++ b/configh.in @@ -255,6 +255,30 @@ #undef HAVE_ALSA_ASOUNDLIB_H +/* + * Do we have the long long type? + */ + +#undef HAVE_LONG_LONG + +#ifdef HAVE_LONG_LONG +# define FLTK_LLFMT "%lld" +# define FLTK_LLCAST (long long) +#else +# define FLTK_LLFMT "%ld" +# define FLTK_LLCAST (long) +#endif /* HAVE_LONG_LONG */ + +/* + * Do we have the strtoll() function? + */ + +#undef HAVE_STRTOLL + +#ifndef HAVE_STRTOLL +# define strtoll(nptr,endptr,base) strtol((nptr), (endptr), (base)) +#endif /* !HAVE_STRTOLL */ + /* * End of "$Id$". */ diff --git a/configure.in b/configure.in index d323ad612..cacd44433 100644 --- a/configure.in +++ b/configure.in @@ -389,6 +389,40 @@ AC_CHECK_FUNCS(localeconv) dnl FLTK library uses math library functions... AC_SEARCH_LIBS(pow, m) +dnl Check for largefile support... +AC_SYS_LARGEFILE + +dnl Define largefile options as needed... +LARGEFILE="" +if test x$enable_largefile != xno; then + LARGEFILE="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE" + + if test $ac_cv_sys_large_files = 1; then + LARGEFILE="$LARGEFILE -D_LARGE_FILES" + fi + + if test $ac_cv_sys_file_offset_bits = 64; then + LARGEFILE="$LARGEFILE -D_FILE_OFFSET_BITS=64" + fi +fi +AC_SUBST(LARGEFILE) + +dnl Check for "long long" support... +AC_CACHE_CHECK(for long long int, ac_cv_c_long_long, + [if test "$GCC" = yes; then + ac_cv_c_long_long=yes + else + AC_TRY_COMPILE(,[long long int i;], + ac_cv_c_long_long=yes, + ac_cv_c_long_long=no) + fi]) + +if test $ac_cv_c_long_long = yes; then + AC_DEFINE(HAVE_LONG_LONG) +fi + +AC_CHECK_FUNC(strtoll, AC_DEFINE(HAVE_STRTOLL)) + dnl Check for audio libraries... AUDIOLIBS="" diff --git a/makeinclude.in b/makeinclude.in index 7985a50ff..e87c95eb5 100644 --- a/makeinclude.in +++ b/makeinclude.in @@ -55,8 +55,8 @@ MAKEDEPEND = @MAKEDEPEND@ # flags for C++ compiler: OPTIM = @OPTIM@ -CFLAGS = $(OPTIM) @CPPFLAGS@ @CFLAGS@ -CXXFLAGS = $(OPTIM) @CPPFLAGS@ @CXXFLAGS@ +CFLAGS = $(OPTIM) @LARGEFILE@ @CPPFLAGS@ @CFLAGS@ +CXXFLAGS = $(OPTIM) @LARGEFILE@ @CPPFLAGS@ @CXXFLAGS@ # program to make the archive: LIBNAME = @LIBNAME@