tech-userlevel archive

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

Re: Definitions of types also as macros

In article <20180908230813.GA22777%SDF.ORG@localhost>,  <> wrote:
>we do this in stdint.h and some other headers:
>#ifndef uint32_t
>typedef __uint32_t      uint32_t;
>#define uint32_t        __uint32_t
>Real-world examples:
>And now I ran into:
>Proposal: let's not define the macros?
>I don't know if there are long running consequences for it.

The problem is that these are defined in multiple headers and
typedef redefinition with the same type is a c11 feature, so the
define protects against that. Of course one can use a different
macro and this was done before, but this has other disadvantages.


Home | Main Index | Thread Index | Old Index