Mail Archives: djgpp/1999/02/02/10:50:53
> In a lot of DJGPP headers I see stuff like
>
> __DJ_pid_t
> #undef __DJ_pid_t
> #define __DJ_pid_t
>
> where the exact string may vary from __DJ_pid_t. What does this do?
ANSI and POSIX require that all headers be independent - you should be
able to include stdio.h without stddef.h and expect everything to just
work. However, they're not independent - there are some things in
stddef.h that are required for stdio.h, like size_t. So, I used the
above constructs to paste in those kinds of definitions where needed
(they originate in <sys/djtypes.h>) without causing "multiple
definitions" errors due to them being in two or more headers.
The first line is replaced with something like "typedef int pid_t".
The second and third make it so that the next time a header does this,
*their* first line gets replaced with "".
- Raw text -