From patchwork Sun Aug 18 18:58:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 1148896 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-507197-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="FRYiqvPD"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46BRD33pMNz9sMr for ; Mon, 19 Aug 2019 04:58:41 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:content-transfer-encoding:mime-version:subject :message-id:date:cc:to; q=dns; s=default; b=NT0E6PLcWcrodNYnJfw5 EIFbFZEm34WI5BbGErNfvsIt9epGhdRdlHz28ISksgw6RjOSlaOo5l8nxgAjpFB2 zfowZcGdL1AxzDZOQehgju+zvzfyXVVtAu5ujXCnW4OOSmK7zWm6hbWEbOJZmhXj WAGXnj3PGu1TuDGt2QMJkVQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:content-transfer-encoding:mime-version:subject :message-id:date:cc:to; s=default; bh=wrzsCeRhm7y+/eXCoXDghE6OMc A=; b=FRYiqvPDhrfms0pJYOOYKWoxkCu3H6IHvdCDyP95vLQZBMkNSwBDg9CwIJ tFv4xjUZlY87Thbhb/C8TxcgtgDHPSjvDBp5KdlqjSmiPMQ78Hh1x/ZOW7FSwtQG Pm7MDdXsMZnX28H0G5k+vBBVaNG7JoFpoEo81NAnrvfyFkFRQ= Received: (qmail 27188 invoked by alias); 18 Aug 2019 18:58:34 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 27176 invoked by uid 89); 18 Aug 2019 18:58:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_COUK, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=manufacturer, HX-Spam-Relays-External:ESMTPA X-HELO: smtp1.wavenetuk.net Received: from smtp.wavenetuk.net (HELO smtp1.wavenetuk.net) (195.26.36.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 18 Aug 2019 18:58:31 +0000 Received: from euterpe-sie.home (host81-138-1-83.in-addr.btopenworld.com [81.138.1.83]) by smtp1.wavenetuk.net (Postfix) with ESMTPA id C72DB1201006; Sun, 18 Aug 2019 19:58:28 +0100 (BST) From: Iain Sandoe Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [Darwin, fixincludes, committed] Fix PR83531 Message-Id: Date: Sun, 18 Aug 2019 19:58:23 +0100 Cc: Mike Stump To: GCC Patches There is no reasonable chance that the SDKs in question will be re- issued, so the only viable solution is a fixincludes. tested on x86_64-darwin, x86_64-linux-gnu, powerpc64-linux-gnu (fixincludes tests pass on linux) applied to mainline, Iain 2019-08-18 C.G. Dogan Iain Sandoe PR target/83531 * inclhack.def (darwin_api_availability): New, strip leading underscores from API_XXXX defines. * fixincl.x: Regenerate. * tests/base/os/availability.h: New file. diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 861532c2a1..3c6b48d26e 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -194,6 +194,33 @@ fix = { _EndOfHeader_; }; +/* + * SDKs for 10.13 and 10.14 omit the definitions for API_AVAILABLE where + * __attribute__((availability)) is not supported. + */ +fix = { + hackname = darwin_api_availability; + mach = "*-*-darwin*"; + files = os/availability.h; + bypass = "__IPHONE_OS_VERSION_MIN_REQUIRED"; + select = + " *#define __API_AVAILABLE.*\n" + " *#define __API_DEPRECATED.*\n" + " *#define __API_DEPRECATED_WITH_REPLACEMENT.*\n" + " *#define __API_UNAVAILABLE.*\n"; + c_fix = format; + c_fix_arg = + " #define API_AVAILABLE(...)\n" + " #define API_DEPRECATED(...)\n" + " #define API_DEPRECATED_WITH_REPLACEMENT(...)\n" + " #define API_UNAVAILABLE(...)\n"; + test_text = + "#define __API_AVAILABLE(...)\n" + "#define __API_DEPRECATED(...)\n" + "#define __API_DEPRECATED_WITH_REPLACEMENT(...)\n" + "#define __API_UNAVAILABLE(...)\n"; +}; + /* * This fixes __FD_ZERO bug for linux 2.x.y (x <= 2 && y <= some n) */ diff --git a/fixincludes/tests/base/os/availability.h b/fixincludes/tests/base/os/availability.h new file mode 100644 index 0000000000..e8696b14ac --- /dev/null +++ b/fixincludes/tests/base/os/availability.h @@ -0,0 +1,18 @@ +/* DO NOT EDIT THIS FILE. + + It has been auto-edited by fixincludes from: + + "fixinc/tests/inc/os/availability.h" + + This had to be done to correct non-standard usages in the + original, manufacturer supplied header file. */ + + + +#if defined( DARWIN_API_AVAILABILITY_CHECK ) + #define API_AVAILABLE(...) + #define API_DEPRECATED(...) + #define API_DEPRECATED_WITH_REPLACEMENT(...) + #define API_UNAVAILABLE(...) + +#endif /* DARWIN_API_AVAILABILITY_CHECK */