]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/blob
49322712ac227f29b67df7fe6c4a56d38eaf06b9
[thirdparty/openembedded/openembedded-core-contrib.git] /
1 From 51d98495d1aac00970d791f064e83ca762bf81c7 Mon Sep 17 00:00:00 2001
2 From: Zack Weinberg <zackw@panix.com>
3 Date: Sun, 2 Apr 2023 10:43:51 -0400
4 Subject: [PATCH 10/29] AC_TYPE_UID_T: Rewrite using AC_CHECK_TYPE.
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 AC_TYPE_UID_T uses AC_EGREP_HEADER to search sys/types.h for
10 occurrences of the string ‘uid_t’ and, if found, assumes both
11 uid_t and gid_t are available. This would be better done using
12 a pair of AC_CHECK_TYPE operations.
13
14 I also converted two uses of old-style AC_CHECK_TYPE, immediately
15 below, to new-style. (There are probably other old-style uses in
16 this file, I only did the ones I happened to see.)
17
18 * lib/autoconf/types.m4 (AC_TYPE_UID_T): Check for uid_t and gid_t,
19 separately, using AC_CHECK_TYPE, instead of grepping sys/types.h.
20 (AC_TYPE_SIZE_T, AC_TYPE_SSIZE_T): Use new-style AC_CHECK_TYPE.
21
22 Upstream-Status: Backport
23 Signed-off-by: Khem Raj <raj.khem@gmail.com>
24 ---
25 lib/autoconf/types.m4 | 30 +++++++++++++++++-------------
26 1 file changed, 17 insertions(+), 13 deletions(-)
27
28 diff --git a/lib/autoconf/types.m4 b/lib/autoconf/types.m4
29 index ebac0cf6d..ef2456135 100644
30 --- a/lib/autoconf/types.m4
31 +++ b/lib/autoconf/types.m4
32 @@ -589,25 +589,29 @@ AC_DEFUN([AC_TYPE_MBSTATE_T],
33
34 # AC_TYPE_UID_T
35 # -------------
36 -# FIXME: Rewrite using AC_CHECK_TYPE.
37 AN_IDENTIFIER([gid_t], [AC_TYPE_UID_T])
38 AN_IDENTIFIER([uid_t], [AC_TYPE_UID_T])
39 AC_DEFUN([AC_TYPE_UID_T],
40 -[AC_CACHE_CHECK(for uid_t in sys/types.h, ac_cv_type_uid_t,
41 -[AC_EGREP_HEADER(uid_t, sys/types.h,
42 - ac_cv_type_uid_t=yes, ac_cv_type_uid_t=no)])
43 -if test $ac_cv_type_uid_t = no; then
44 - AC_DEFINE(uid_t, int, [Define to 'int' if <sys/types.h> doesn't define.])
45 - AC_DEFINE(gid_t, int, [Define to 'int' if <sys/types.h> doesn't define.])
46 -fi
47 -])
48 -
49 -
50 +[AC_CHECK_TYPE([uid_t], [],
51 + [AC_DEFINE([uid_t], [int],
52 + [Define as 'int' if <sys/types.h> doesn't define.])])
53 +AC_CHECK_TYPE([gid_t], [],
54 + [AC_DEFINE([gid_t], [int],
55 + [Define as 'int' if <sys/types.h> doesn't define.])])])
56 +
57 +# This should be obsoleted, size_t is in C90.
58 AN_IDENTIFIER([size_t], [AC_TYPE_SIZE_T])
59 -AC_DEFUN([AC_TYPE_SIZE_T], [AC_CHECK_TYPE(size_t, unsigned int)])
60 +AC_DEFUN([AC_TYPE_SIZE_T],
61 +[AC_CHECK_TYPE([size_t], [],
62 + [AC_DEFINE([size_t], [unsigned int],
63 + [Define as 'unsigned int' if <stddef.h> doesn't define.])])])
64
65 AN_IDENTIFIER([ssize_t], [AC_TYPE_SSIZE_T])
66 -AC_DEFUN([AC_TYPE_SSIZE_T], [AC_CHECK_TYPE(ssize_t, int)])
67 +AC_DEFUN([AC_TYPE_SSIZE_T],
68 +[AC_CHECK_TYPE([ssize_t], [],
69 + [AC_DEFINE([ssize_t], [int],
70 + [Define as 'int' if <sys/types.h> doesn't define.])])])
71 +
72
73 AN_IDENTIFIER([pid_t], [AC_TYPE_PID_T])
74 AC_DEFUN([AC_TYPE_PID_T],
75 --
76 2.41.0
77