Debian Codegraph @

tools/gnulib/m4/pid_t.m4

raw
1 # pid_t.m4
2 # serial 4
3 dnl Copyright (C) 2020-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7
8 # The following implementation works around a problem in autoconf <= 2.69.
9 m4_version_prereq([2.70], [], [
10
11 dnl Define pid_t if the headers don't define it.
12 AC_DEFUN([AC_TYPE_PID_T],
13 [
14 AC_CHECK_TYPE([pid_t],
15 [],
16 [dnl On 64-bit native Windows, define it to the equivalent of 'intptr_t'
17 dnl (= 'long long' = '__int64'), because that is the return type
18 dnl of the _spawnv* functions
19 dnl <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/spawnvp-wspawnvp>
20 dnl and the argument type of the _cwait function
21 dnl <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/cwait>.
22 dnl Otherwise (on 32-bit Windows and on old Unix platforms), define it
23 dnl to 'int'.
24 AC_COMPILE_IFELSE(
25 [AC_LANG_PROGRAM([[
26 #if defined _WIN64 && !defined __CYGWIN__
27 LLP64
28 #endif
29 ]])
30 ],
31 [gl_pid_type='int'],
32 [gl_pid_type='__int64'])
33 AC_DEFINE_UNQUOTED([pid_t], [$gl_pid_type],
34 [Define as a signed integer type capable of holding a process identifier.])
35 ],
36 [AC_INCLUDES_DEFAULT])
37 ])
38
39 ])# m4_version_prereq 2.70