From owner-dev-commits-src-branches@freebsd.org Thu Dec 31 20:47:20 2020 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 993F24CF609; Thu, 31 Dec 2020 20:47:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D6Kw83w4dz3qMy; Thu, 31 Dec 2020 20:47:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7905516BF5; Thu, 31 Dec 2020 20:47:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BVKlKmw049561; Thu, 31 Dec 2020 20:47:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BVKlKZp049560; Thu, 31 Dec 2020 20:47:20 GMT (envelope-from git) Date: Thu, 31 Dec 2020 20:47:20 GMT Message-Id: <202012312047.0BVKlKZp049560@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ryan Libby Subject: git: 939430f23771 - stable/12 - Fix the build of scandir_b with GCC. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 939430f23771bb2bdd85337a58f5ba0757f60782 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2020 20:47:20 -0000 The branch stable/12 has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=939430f23771bb2bdd85337a58f5ba0757f60782 commit 939430f23771bb2bdd85337a58f5ba0757f60782 Author: John Baldwin AuthorDate: 2020-08-31 21:55:25 +0000 Commit: Ryan Libby CommitDate: 2020-12-31 19:56:33 +0000 Fix the build of scandir_b with GCC. Use explicit typedefs for block thunk structures as in r264143. Reviewed by: kib, adrian MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26256 (cherry picked from commit d10af81d2defe43db0db0a7dca3eefb047bd8ddc) --- lib/libc/gen/scandir.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/libc/gen/scandir.c b/lib/libc/gen/scandir.c index 2b8d244bcc59..10cd7633dac1 100644 --- a/lib/libc/gen/scandir.c +++ b/lib/libc/gen/scandir.c @@ -56,15 +56,18 @@ void qsort_b(void *, size_t, size_t, void *); #define SELECT(x) select(x) #endif -#ifndef I_AM_SCANDIR_B +#ifdef I_AM_SCANDIR_B +typedef DECLARE_BLOCK(int, select_block, const struct dirent *); +typedef DECLARE_BLOCK(int, dcomp_block, const struct dirent **, + const struct dirent **); +#else static int alphasort_thunk(void *thunk, const void *p1, const void *p2); #endif int #ifdef I_AM_SCANDIR_B -scandir_b(const char *dirname, struct dirent ***namelist, - DECLARE_BLOCK(int, select, const struct dirent *), - DECLARE_BLOCK(int, dcomp, const struct dirent **, const struct dirent **)) +scandir_b(const char *dirname, struct dirent ***namelist, select_block select, + dcomp_block dcomp) #else scandir(const char *dirname, struct dirent ***namelist, int (*select)(const struct dirent *), int (*dcomp)(const struct dirent **,