autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AC_SYS_LARGEFILE_REQUIRED vs. AC_SYS_YEAR2038_REQUIRED on MSVC


From: Bruno Haible
Subject: Re: AC_SYS_LARGEFILE_REQUIRED vs. AC_SYS_YEAR2038_REQUIRED on MSVC
Date: Sun, 16 Apr 2023 02:05:41 +0200

I wrote:
> > Also, maybe it is necessary to distinguish the use of these two Autoconf
> > macros without and with Gnulib?
> >    - Without Gnulib, they could both fail on MSVC.
> >    - But with Gnulib, they should both succeed on MSVC.

but I was wrong regarding the expected outcome. The correct expectations are:

* For AC_SYS_LARGEFILE_REQUIRED:
  - With mingw:
      checking for <$CC> option to enable large file support... 
-D_FILE_OFFSET_BITS=64
  - With MSVC:
    Without gnulib:
      checking for <$CC> option to enable large file support... support not 
detected
      and configure fails.
    With gnulib:
      checking for <$CC> option to enable large file support... supported 
through gnulib

* For AC_SYS_YEAR2038_REQUIRED:
  time_t is already 64-bits on 64-bit mingw and on MSVC.
  So:
    - with 32-bit mingw:
        checking for <$CC> option to enable timestamps after Jan 2038... 
-D__MINGW_USE_VC2005_COMPAT
    - with 64-bit mingw or MSVC:
        checking for <$CC> option to enable timestamps after Jan 2038... none 
needed
  Configuration will not fail due to time_t.
  But configuration will fail with MSVC and without gnulib (see above).

Paul Eggert wrote:
> I don't use MSVC.

I dug a bit and came up with the attached two proposed patches, one for
Autoconf and one for Gnulib.

In combination with Gnulib, they achieve the expected outcome described
above. I.e. no configure failure in any of the 4 native Windows platforms.

Without Gnulib, I believe (but haven't tested) that the outcome is as
described above as well.

> > Also, maybe it is necessary to distinguish the use of these two Autoconf
> > macros without and with Gnulib?
> >    - Without Gnulib, they could both fail on MSVC.
> >    - But with Gnulib, they should both succeed on MSVC.
> 
> That is what would happen if we could write a gl_YEAR2038, I assume.

It turned out that a gl_YEAR2038 is not needed, because native Windows
is not a special case regarding the time_t size: in 3 cases the result is
"none needed", in 1 case the result is a C macro definition that gets
put into config.h. And this C macro definition is effective without
any further help from Gnulib.

Bruno

Attachment: 0001-AC_SYS_YEAR2038_REQUIRED-Fix-configure-failure-with-.patch
Description: Text Data

Attachment: 0001-year2038-required-Fix-configure-failure-with-MSVC.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]