From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bruno Haible Newsgroups: gmane.comp.lib.gnulib.bugs,gmane.emacs.devel Subject: Re: boot-time: straighten code Date: Sun, 13 Aug 2023 16:36:47 +0200 Message-ID: <3909139.bdzUSs2D5r@nimes> References: <4536176.VaOIPsP7d9@nimes> <5a77c0b9-8692-83bf-1aca-2f1d27122877@cs.ucla.edu> <87v8djoc6n.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28198"; mail-complaints-to="usenet@ciao.gmane.io" Cc: bug-gnulib@gnu.org, Emacs-devel@gnu.org To: Paul Eggert , Po Lu Original-X-From: bug-gnulib-bounces+gnu-bug-gnulib=m.gmane-mx.org@gnu.org Sun Aug 13 16:37:32 2023 Return-path: Envelope-to: gnu-bug-gnulib@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qVCDk-000796-3e for gnu-bug-gnulib@m.gmane-mx.org; Sun, 13 Aug 2023 16:37:32 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qVCD9-0008OF-Ml; Sun, 13 Aug 2023 10:36:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qVCD7-0008MM-Ur; Sun, 13 Aug 2023 10:36:53 -0400 Original-Received: from mo4-p01-ob.smtp.rzone.de ([85.215.255.53]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qVCD5-0005WF-Cn; Sun, 13 Aug 2023 10:36:53 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1691937408; cv=none; d=strato.com; s=strato-dkim-0002; b=k0h8fpCtLosQrXEuL31T+sAVk2nhYrTEqWo2sVUM49WrpfFMERVpBAtrIaREjCkc9z jmUWz2DBgXzlUuZHnduD1JUmPjIyuxK8AGU+/wzcP96R+ZRIu2B3Negt842CzcdkkZxj yJB+ihoXx6n8F3F0/FOgUvsfUw9hFM5nIyWywy50sCsfSU1OgS6jsmpPoJ2YKu878uuS 3OjsKFDwNO7i2A9Tkl6Y2QDe+Ei1F4A+Ij4L910/xOX5kjPd9S77/3EfzHnFj2dIDMVF NnqL8Wgygzpc5TypHO8Eig6FRrYBrwddKgcdIHT+dhWw8p29EYSBidwLBzyi2cuweN7S WcVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1691937408; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=uTJgS7MTrjiK91mB/vZ7hU//2nKr8LHYDgsG9ApSIqI=; b=kQ48OBBPEFLBZoAQqCVlPNTyaj2tEU8oNGc+JvYbbUl9SCvB8iIRVEwTJSBEAUDtWt rC/YRuwuy3m8teHTK8+ALXltQwXZN1si9qJ0AIxKX0Ug6ZxCcAiYGsyS22QUb/JsamYN ptrLYMMdVjXO3uWS36muKytvC26PswEbchk6YSIWeNNQjlYaffWdRZI1/aVZITtY3VkZ XZjM0P45fTuukW77sbkBluhqKuYTJBwYA+oSAdq85FihMa+qGVAN2SGxuSDW3fa+VZW5 y0eFhWxzLbnlDkn/ZkuW3JknWD4xuZ4DRY1sxiPEOtD1Tctwq4IGaqbIh14KH4kdax6e KlWw== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo01 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1691937408; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=uTJgS7MTrjiK91mB/vZ7hU//2nKr8LHYDgsG9ApSIqI=; b=QImBkps71Iemx3fngr5iJlisQXf4fnbhY0l53Bg2W8FXwOaRyhdWYjSrQLKj74yA5+ hoXOTaiouCdbavl/9ee17vGv83wJdkgBE+vzZ0WscbXk82sPr6A5+iN1TXhXDUg3C0k/ SivAhfOu/iQQeSlj1B3fXU49nqfKY+Q04nTsOWFW6Y0jXrOiLyrAO6NNo1iI/2CgPdMh zIx5L+Ulaph44Yc53gLVEUs/ZA0U6Tk49t0SEQBL0F0+5XpYOJ6IrcVhTg9b64d8np+I UoMIE0wNn9rArTRaKHQbja6eX0Zt2FQzyc/8jooSnn8FUpBlnJjYRYX6zLag2MINJQRI hynw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1691937408; s=strato-dkim-0003; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=uTJgS7MTrjiK91mB/vZ7hU//2nKr8LHYDgsG9ApSIqI=; b=2Av1oM3b9tz9Zo1nN80V7NOdaNL9mMZsSThilY8F90r+EfiG7hY6Ddhqbqis7XO3w2 0QoKD/EdZ0mJaQbgMrBg== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94zq68+3cfpPF3fYsxbAVaMn7wIQE2qpZc5CC1Q==" Original-Received: from nimes.localnet by smtp.strato.de (RZmta 49.6.6 AUTH) with ESMTPSA id x129eaz7DEamAqh (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Sun, 13 Aug 2023 16:36:48 +0200 (CEST) In-Reply-To: <87v8djoc6n.fsf@yahoo.com> Received-SPF: none client-ip=85.215.255.53; envelope-from=bruno@clisp.org; helo=mo4-p01-ob.smtp.rzone.de X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+gnu-bug-gnulib=m.gmane-mx.org@gnu.org Original-Sender: bug-gnulib-bounces+gnu-bug-gnulib=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.comp.lib.gnulib.bugs:48175 gmane.emacs.devel:308680 Archived-At: Po Lu wrote: > During the automated build of the Android port, the following errors > were encountered with the Android NDK r10b and __ANDROID_API__ set to 8 > (which is the oldest configuration Emacs supports.) > ... > boot-time.c: In function 'get_boot_time_uncached': > boot-time.c:111:26: error: 'BOOT_TIME' undeclared (first use in this func= tion) > if (ut->ut_type =3D=3D BOOT_TIME) > ^ Unlike USER_PROCESS, which is defined in all versions of Android's , BOOT_TIME is only defined in newer versions. When compiling against an older version, we need to use the value from the newer versions =E2=80=94 otherwise a binary built against an older version = might not work right when running on a newer Android. This patch does it. 2023-08-13 Bruno Haible readutmp, boot-time: Fix compilation error on old Android. Reported by Po Lu in . * lib/readutmp.h (BOOT_TIME): Add fallback. diff --git a/lib/readutmp.h b/lib/readutmp.h index 1cf588d265..f7cad36d44 100644 =2D-- a/lib/readutmp.h +++ b/lib/readutmp.h @@ -249,6 +249,13 @@ struct utmpx32 # define WTMP_FILE "/etc/wtmp" #endif =20 +/* In early versions of Android, did not define BOOT_TIME, only + USER_PROCESS. We need to use the value that is defined in newer versio= ns + of Android. */ +#if defined __ANDROID__ && !defined BOOT_TIME +# define BOOT_TIME 2 +#endif + /* Some platforms, such as OpenBSD, don't have an ut_type field and don't = have the BOOT_TIME and USER_PROCESS macros. But we want to support them in 'struct gl_utmp'. */