<div dir="ltr">I'm not completely sure what you're saying, but doesn't drm_base_types.h (now drm_basic_types.h) make things robust to header order? The patch is in another email. You can also see it here: <a href="https://github.com/jpark37/linux/commit/0cc8ae750bfd9eab7e31c7de6aa84f24682f4f18">https://github.com/jpark37/linux/commit/0cc8ae750bfd9eab7e31c7de6aa84f24682f4f18</a><div><br></div><div>Thanks,</div><div>James</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 7, 2020 at 12:51 AM Pekka Paalanen <<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, 4 Dec 2020 11:07:41 -0800<br>
James Park <<a href="mailto:james.park@lagfreegames.com" target="_blank">james.park@lagfreegames.com</a>> wrote:<br>
<br>
> I could adjust the block to look like this:<br>
> <br>
> #ifdef DRM_FOURCC_STANDALONE<br>
> #if defined(__linux__)<br>
> #include <linux/types.h><br>
> #else<br>
> #include <stdint.h><br>
> typedef uint32_t __u32;<br>
> typedef uint64_t __u64;<br>
> #endif<br>
> #else<br>
> #include "drm.h"<br>
> #endif<br>
> <br>
> Alternatively, I could create a new common header to be included from both<br>
> drm.h and drm_fourcc.h, drm_base_types.h or something like that:<br>
> <br>
> #ifdef DRM_FOURCC_STANDALONE<br>
> #include "drm_base_types.h"<br>
> #else<br>
> #include "drm.h"<br>
> #endif<br>
<br>
Hi,<br>
<br>
my point is, any solution relying on DRM_FOURCC_STANDALONE will fail<br>
sometimes, because there is no reason why userspace would *not* #define<br>
DRM_FOURCC_STANDALONE. Hence, #ifdef DRM_FOURCC_STANDALONE is<br>
completely moot, you have to make the headers work in any include<br>
order when DRM_FOURCC_STANDALONE is defined anyway.<br>
<br>
<br>
Thanks.<br>
pq<br>
<br>
> On Fri, Dec 4, 2020 at 7:58 AM Daniel Vetter <<a href="mailto:daniel@ffwll.ch" target="_blank">daniel@ffwll.ch</a>> wrote:<br>
> <br>
> > On Fri, Dec 4, 2020 at 9:12 AM Pekka Paalanen <<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.com</a>> wrote:  <br>
> > ><br>
> > > On Thu, 3 Dec 2020 21:45:14 +0100<br>
> > > Daniel Vetter <<a href="mailto:daniel@ffwll.ch" target="_blank">daniel@ffwll.ch</a>> wrote:<br>
> > >  <br>
> > > > On Thu, Dec 3, 2020 at 7:55 PM James Park <<a href="mailto:james.park@lagfreegames.com" target="_blank">james.park@lagfreegames.com</a>>  <br>
> > wrote:  <br>
> > > > ><br>
> > > > > The trailing underscore for  DRM_FOURCC_STANDALONE_ isn't<br>
> > > > > intentional, right? Should I put all the integer types, or just the<br>
> > > > > ones that are used in that file?  <br>
> > > ><br>
> > > > Yeah that trailing _ just slipped in. And I'd just do the types<br>
> > > > already used. I don't think anything else than __u32 (for drm fourcc)<br>
> > > > and __u64 (for drm modifier) is needed.  <br>
> > ><br>
> > > Hi,<br>
> > ><br>
> > > can that create conflicts if userspace first includes drm_fourcc.h and<br>
> > > then drm.h?<br>
> > ><br>
> > > I would find it natural to userspace have generic headers including<br>
> > > drm_fourcc.h and then DRM-specific C-files including drm.h as well<br>
> > > (through libdrm headers). I think Weston might already do this.<br>
> > ><br>
> > > The generic userspace (weston) header would obviously #define<br>
> > > DRM_FOURCC_STANDALONE, because it is used by non-DRM C-files as well.  <br>
> ><br>
> > Hm yes that would break. I guess we could just include the linux types<br>
> > header for this. And I guess on windows you'd need to have that from<br>
> > somewhere. Or we just require that users of the standalone header pull<br>
> > the right header or defines in first?<br>
> > -Daniel<br>
> > --<br>
> > Daniel Vetter<br>
> > Software Engineer, Intel Corporation<br>
> > <a href="http://blog.ffwll.ch" rel="noreferrer" target="_blank">http://blog.ffwll.ch</a><br>
> >  <br>
<br>
</blockquote></div>