[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to handle architecture dependent headers in subdirectories



On Thu, 2013-01-17 at 12:06 +0000, Thorsten Glaser wrote:
> Adam Borowski <kilobyte <at> angband.pl> writes:
> 
> > This looks just like the solution ultimately chosen for #682183, except for
> > the include being monstrous.  Let's instead add a file to libc6-dev with
> > the following:
> > 
> > #define DEB_HOST_MULTIARCH "x86_64-linux-gnu"
> 
> And then #include "<" DEB_HOST_MULTIARCH "/foo/bar.h" or what?
> Is that even valid C?

It's not standard, nor is it supported in gcc (coincidentally I had a
completely different reason to try it yesterday).

> (#include CONFIG_H works in GCC, but…)

That *is* standard, but limited to a single macro.

I think gcc also supports use of a function-macro invocation which could
do the pasting, but that's non-standard.

Ben.

> Also… thinking about this a bit longer… a switch like Doko’s is
> more correct because, in the M-A case, it’s all about *not* needing
> to specify the architecture in some file. It’s just divined from
> the current compiler configuration. I think it has some merit.


-- 
Ben Hutchings
I'm not a reverse psychological virus.  Please don't copy me into your sig.

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: