[sr #110296] AC_TYPE_PID_T defines pid_t incorrectly on 64-bit MSVC

Bruno Haible <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.bugs
Message-ID <[email protected]>
URL:
  <https://savannah.gnu.org/support/?110296>

                 Summary: AC_TYPE_PID_T defines pid_t incorrectly on 64-bit
MSVC
                 Project: Autoconf
            Submitted by: haible
            Submitted on: Mon 24 Aug 2020 01:36:11 AM CEST
                Category: None
                Priority: 5 - Normal
                Severity: 3 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

On 64-bit native Windows, pid_t has to be a 64-bit type, as explained in
https://lists.gnu.org/archive/html/bug-gnulib/2020-08/msg00209.html .

With mingw, there is no problem, as mingw defines pid_t correctly.

But on MSVC (and MSVC/clang), the type pid_t is not defined, neither by the
standard header files nor by the compiler. The AC_TYPE_PID_T therefore kicks
in and defines it. But it defines it incorrectly, namely to 'int', where
instead 'long long' or '__int64' is the correct definition. For compatibility
with MSVC versions < 14 (older than 2015), it is best to use '__int64', as
support for 'long long' was only added in MSVC 14 (Visual Studio 2015).

Patch is attached.




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/support/?110296>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.