From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF08DC0018C for ; Mon, 7 Dec 2020 08:57:29 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9DD4B2312F for ; Mon, 7 Dec 2020 08:57:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9DD4B2312F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lagfreegames.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4829289ED3; Mon, 7 Dec 2020 08:56:51 +0000 (UTC) Received: from mail-vs1-xe41.google.com (mail-vs1-xe41.google.com [IPv6:2607:f8b0:4864:20::e41]) by gabe.freedesktop.org (Postfix) with ESMTPS id BE2846E14F for ; Fri, 4 Dec 2020 09:48:00 +0000 (UTC) Received: by mail-vs1-xe41.google.com with SMTP id s85so2920962vsc.3 for ; Fri, 04 Dec 2020 01:48:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lagfreegames.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DgNzkpYbR088s1hhDlFJ4RLB9IvFauB+JyzYvIvja0Y=; b=KIKPH5oETlyEKGWF7EGVZMivf2cX3T1QUigYIo17I8wBcH0CzIwH37YKohmJkD8vUz avBRqxk5QhkAc02jAqQmrA+hGg43NARiZ7dqomjMwwBuAKl0nK8zLzN0adKg/fbiLWx+ Riw6U5cmw6tlxX9eV7eEQe00B8LSq1iY269d4J639khw0hCVjfqtUIg4H24s4U29+/U3 OLPfaQm0gqHioPhdS0aEzx1xNaXtXti3wUyyCuVGWDid4L4eq5wji4lfPkxf8VhzdmTs RFff+vQdWk7edmx90RiJ+dRIN52cyQtVQWnV5zHIhd1vniZGhKlkpyNONKhNOySqEwEG zFxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DgNzkpYbR088s1hhDlFJ4RLB9IvFauB+JyzYvIvja0Y=; b=PB6y0WVT8Vo+25PI2kQzQNqJPIrnL4NNArj3BgaYE96rF5C0lFXb8Io8MNhgrze/Q6 Tkcdk16kGf0M4qLEFtYfp9lhCaO1E3Qeoit1P5rvevUU8MA0hwBD/aULMldjDq1Uf+Do 8Ti0jRhSQJOiBc1X3ZBI/WgbSMmg7cXAzuYZAw119VeAnV9bHcnDA9hZrkGTpV4VQnWp gnXAO8NBuDtoLmMpm4nE85GM4AleeHA6HYXHmDopXHw9sBYiM/ChQ78C0QzKt04j7jRf 2qjTD+I21ae78QxA8DtP24uzal3dpN3vZutEVOcCny0LxWPiqohprQBFaG0/R1SrG/yn sCZw== X-Gm-Message-State: AOAM533YrkFVoV8OeVOlAFWtwVPV8m0kifUj7RcqSmLvbxzJJYEClqR9 ihJtK79oMhDtgl66mopR6F4DwHPjZKBfZJVjGaPSZZX8AFnv4gZf X-Google-Smtp-Source: ABdhPJyFyzUh7upVAKuJnETLcDmRpBUxki9wuNxRHHG2RJtqW7lmQddpAdFNOaqBSdvZDkl2NM9j0Kq+vOLnubAhPI8= X-Received: by 2002:a67:7902:: with SMTP id u2mr2117838vsc.41.1607075279917; Fri, 04 Dec 2020 01:47:59 -0800 (PST) MIME-Version: 1.0 References: <1607057617-145-1-git-send-email-jpark37@lagfreegames.com> <1607057617-145-2-git-send-email-jpark37@lagfreegames.com> In-Reply-To: From: James Park Date: Fri, 4 Dec 2020 01:47:11 -0800 Message-ID: Subject: Re: [PATCH] drm: Allow drm_fourcc.h without including drm.h To: Simon Ser X-Mailman-Approved-At: Mon, 07 Dec 2020 08:56:49 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "dri-devel@lists.freedesktop.org" , James Park Content-Type: multipart/mixed; boundary="===============0217272361==" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" --===============0217272361== Content-Type: multipart/alternative; boundary="0000000000002fe99505b5a05fb6" --0000000000002fe99505b5a05fb6 Content-Type: text/plain; charset="UTF-8" The typedefs might also conflict on Linux if DRM_FOURCC_STANDALONE is enabled with whatever LInux declared __u32/__u64 as, but I think the implication is that once DRM_FOURCC_STANDALONE has been declared, that's kind of a promise not to include drm.h. I'm fine with this, but I'm not married to it if someone has a problem where they want to define DRM_FOURCC_STANDALONE, but also can't avoid including drm.h for some reason. On Fri, Dec 4, 2020 at 12:53 AM Simon Ser wrote: > On Friday, December 4, 2020 5:53 AM, James Park > wrote: > > > +#ifdef DRM_FOURCC_STANDALONE > > +#include > > > > +typedef uint32_t __u32; > > +typedef uint64_t __u64; > > +#else > > #include "drm.h" > > +#endif > > C11 allows duplicate typedefs, but older versions of the standard > don't AFAIK. If this is a concern, a solution would be to guard the > typedefs. > --0000000000002fe99505b5a05fb6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The typedefs might also conflict on Linux if DRM_FOURCC_ST= ANDALONE is enabled with whatever LInux declared __u32/__u64 as, but I thin= k the implication is that once DRM_FOURCC_STANDALONE has been declared, tha= t's kind of a promise not to include drm.h.

I= 9;m fine with=C2=A0this, but I'm not married to it if someone has a pro= blem where they want to define DRM_FOURCC_STANDALONE, but also can't av= oid including drm.h for some reason.

On Fri, Dec 4, 2020 at 12:53 AM S= imon Ser <contact@emersion.fr= > wrote:
On F= riday, December 4, 2020 5:53 AM, James Park <jpark37@lagfreegames.com> wrote:<= br>
> +#ifdef DRM_FOURCC_STANDALONE
> +#include <stdint.h>
>
> +typedef uint32_t __u32;
> +typedef uint64_t __u64;
> +#else
> #include "drm.h"
> +#endif

C11 allows duplicate typedefs, but older versions of the standard
don't AFAIK. If this is a concern, a solution would be to guard the
typedefs.
--0000000000002fe99505b5a05fb6-- --===============0217272361== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel --===============0217272361==--