From patchwork Wed Apr 17 06:02:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 1086793 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-499348-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=gdcproject.org 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 44kWqT6MJvz9s4Y for ; Wed, 17 Apr 2019 16:02:43 +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 :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=hgew9MkDmwNT7LEitr5PE6NheNTOfEsOuti3Sth/VvUjwY XbJr/pstnh7cL3wlbNs9FzQhr7Dct0mywL9ZBS15g92bPcXKy/6Y5aOmADE+tds7 eE+IGHwy5daCJh6Ftr8z6Ga9+43Gd3T+c61wB6To9xD+trCWH+AdofxaVp6N0= 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 :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=1lNIMoumCRU02NGYRdmHjUDh6yw=; b=jbiHHD44JnwUeHl2BMHh csbnLiYU12cQv+XeP6VHSmMED/tGxxRPbz2TDkcqCahSCBPYP5OKMlpEzwW+6Eer 7qAmM5iCkLdtxRKqSbWFcyiSO6+oe9VjDAjJ+Wa83zThMS7I9W0/gXYkQ4YqZita dVuq4gPaXfsJZORXNQtHA6I= Received: (qmail 69487 invoked by alias); 17 Apr 2019 06:02: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 69477 invoked by uid 89); 17 Apr 2019 06:02:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.0 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-qk1-f179.google.com Received: from mail-qk1-f179.google.com (HELO mail-qk1-f179.google.com) (209.85.222.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 17 Apr 2019 06:02:33 +0000 Received: by mail-qk1-f179.google.com with SMTP id 193so552426qki.6 for ; Tue, 16 Apr 2019 23:02:33 -0700 (PDT) MIME-Version: 1.0 From: Iain Buclaw Date: Wed, 17 Apr 2019 08:02:20 +0200 Message-ID: Subject: [PATCH, d] Committed fix building on hosts missing _MIN and MAX macros To: gcc-patches X-IsSubscribed: yes Hi, This patch adds missing macros that the dmd front-end makes use of, as seen on one of the BSDs where the include for int_const.h is guarded, and defines any __unix__ system as being POSIX. Bootstrapped and regression tested on x86_64-linux-gnu. Committed to trunk as r270403. diff --git a/gcc/d/d-system.h b/gcc/d/d-system.h index 142b03dc80f..b6f4ee5302a 100644 --- a/gcc/d/d-system.h +++ b/gcc/d/d-system.h @@ -25,7 +25,7 @@ /* Used by the dmd front-end to determine if we have POSIX-style IO. */ #define POSIX (__linux__ || __GLIBC__ || __gnu_hurd__ || __APPLE__ \ || __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__ \ - || __sun) + || __sun || __unix__) /* Forward assert invariants to gcc_assert. */ #undef assert @@ -61,4 +61,21 @@ #define _mkdir(p) mkdir(p, 0) #endif +/* Define any missing _MAX and _MIN macros. */ +#ifndef INT32_MAX +# define INT32_MAX INTTYPE_MAXIMUM (int32_t) +#endif +#ifndef INT32_MIN +# define INT32_MIN INTTYPE_MINIMUM (int32_t) +#endif +#ifndef INT64_MIN +# define INT64_MIN INTTYPE_MINIMUM (int64_t) +#endif +#ifndef UINT32_MAX +# define UINT32_MAX INTTYPE_MAXIMUM (uint32_t) +#endif +#ifndef UINT64_MAX +# define UINT64_MAX INTTYPE_MAXIMUM (uint64_t) +#endif + #endif /* GCC_D_SYSTEM_H */