Re: Delay Routine: Fully-portable C89 if possible
- From: Hans-Bernhard Bröker <HBBroeker@xxxxxxxxxxx>
- Date: Thu, 11 Oct 2007 21:06:03 +0200
Everett M. Greene wrote:
Does anyone have a public domain copy of stdint.h?
Impossible. The interface provided by <stdint.h> is standardized --- but it's actual content isn't, and can't be.
If portable code could define uint32_t itself, there would be no point for <stdint.h> to exist. This header *has* to be either provided by the compiler writer, or tailored to a particular compiler by an informed programmer.
Any number of people speak of rolling their own, but that seems a
little silly if it's advocated that as many people as possible use
stdint.h.
The point is that you should only roll your own if the compiler authors didn't provide on. But if you *are* going to roll your own, it's a good idea to roll your own along the lines of the standard version, rather than inventing yet another set of my_u32 types.
One of the problems this would avoid involves libraries from several independent vendors all used in the same project, who each thought they should roll their own type names for this, instead of following the C99 guidelines. The inevitable result is that two of them chose the *same* names, and now you get to resolve type redefinitions among other people's header files. Great fun --- not!
.
- Follow-Ups:
- Re: Delay Routine: Fully-portable C89 if possible
- From: Martin Wells
- Re: Delay Routine: Fully-portable C89 if possible
- References:
- Delay Routine: Fully-portable C89 if possible
- From: Martin Wells
- Re: Delay Routine: Fully-portable C89 if possible
- From: David Brown
- Re: Delay Routine: Fully-portable C89 if possible
- From: Martin Wells
- Re: Delay Routine: Fully-portable C89 if possible
- From: John Devereux
- Re: Delay Routine: Fully-portable C89 if possible
- From: David Brown
- Re: Delay Routine: Fully-portable C89 if possible
- From: CBFalconer
- Re: Delay Routine: Fully-portable C89 if possible
- From: Tom
- Re: Delay Routine: Fully-portable C89 if possible
- From: Everett M. Greene
- Delay Routine: Fully-portable C89 if possible
- Prev by Date: Re: Delay Routine: Fully-portable C89 if possible
- Next by Date: Re: Delay Routine: Fully-portable C89 if possible
- Previous by thread: Re: Delay Routine: Fully-portable C89 if possible
- Next by thread: Re: Delay Routine: Fully-portable C89 if possible
- Index(es):
Relevant Pages
|