[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Avoiding #define uint8_t (and similar) in stdint.h
On Thu, Dec 18, 2014 at 10:05:26PM +0100, Rhialto wrote:
> Unfortunately, duplicate typedefs are not allowed, even if identical.
> I suppose that's what the #ifdef dance is for, to avoid them at all
> costs. Especially if including other header files may cause them to be
Hmm, is that a C++ism? gcc does not warn about it.
> Whether it can be done in a better way is another matter of course.
> But a #define can be #ifdef'ed, where a typedef can't.
A third option, of course, is to separarte the typedefs into something
like <int-typedefs-internal.h>, use that from everywhere, and use stock
duplicate include protection for that.
Main Index |
Thread Index |