tech-toolchain archive

[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 18 Dec 2014 at 21:22:16 +0100, Martin Husemann wrote:
> Another option would be to remove the #ifdef dance alltogether and just risk
> duplicate (but identical) typedefs, using the compiler predefined defines:
> typedef __UINT8_TYPE__ uint8_t;

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

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.

___ Olaf 'Rhialto' Seibert  -- The Doctor: No, 'eureka' is Greek for
\X/ rhialto/at/    -- 'this bath is too hot.'

Attachment: pgpiJDjNbCDHE.pgp
Description: PGP signature

Home | Main Index | Thread Index | Old Index