include files -- help needed

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Fri Jun 28 09:11:36 AEST 1991


In article <4896 at inews.intel.com> bhoughto at bishop.intel.com (Blair P. Houghton) writes:
> In article <1991Jun26.213114.236 at druid.uucp> darcy at druid.uucp (D'Arcy J.M. Cain) writes:
> >Why go through that?  I assume you mean that you have something like time.h
> >and sys/time.h so just prepend _SYS_ to the defines in the sys directory:
> Anyone know a system where one's not just a {link,symlink} to the other?

Yep: a perfectly-standard-except-all-those-little-porting-bugs BSD 4.3
system.

> What is the difference?

They're not just different. They're incompatible. They end up defining
struct tm in two different ways; the people who ported the system to
this hardware managed to copy the definition from somewhere else to
<sys/time.h>.

As another example, our BSD 4.3+NFS Mt. XINU system has struct tm in
<time.h>. <sys/time.h> has various timefoo definitions for various foo,
then #ifndef KERNEL #include <time.h> #endif.

In any case, there are lots of other examples of include files where you
want to prepend the directory name instead of assuming a flat namespace.

---Dan



More information about the Comp.lang.c mailing list