tech-pkg archive

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

Re: macro expansion and types in <sys/types.h>



On Sat, 06 Sep 2014, Brook Milligan wrote:
It's allowed for a macro to be #define'd as itself [...]
So, we could rewrite the above code as follows:

        #ifndef uint16_t
        typedef __uint16_t uint16_t;
        #define uint16_t   uint16_t
        #endif

If we were to do this, I believe it would solve the problem I am currently having as the "public" identifiers, e.g., uint16_t, wouldn't be replaced. It also seems like many (all?) uses of __unit16_t would do the right thing. Perhaps those that don't are errors anyway, because __uint16_t and the like are implementation defined?

What are the implications of making a change like this?

I am not aware of any adverse consequences, and several parts of the NetSBD system include files could be simplified. Somebody just needs to do the work, and discuss it in tech-userlevel.

--apb (Alan Barrett)


Home | Main Index | Thread Index | Old Index