httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <>
Date Tue, 10 Mar 1998 05:42:47 GMT
Uh why is os.h included before conf.h?  Is it just 'cause WIN32's
definitions are all in os.h?  That's kind of lame. 

obautoconfism: elided. 

I personally find it hard to wade through lots of levels of #ifdefism
(i.e. http_main.c, conf.h to a lesser extent).  I'd rather see things
moved out of conf.h into os.h files.  I believe Ben Hyde feels the
opposite way -- because that results in poor maintenance of other ports
because they're "out of sight, out of mind".

Dunno what to say really.  But hey, here's a useful sh script:

find . \( -name '*.[cChHylsS]' -o -name '*.cpp' -o -name '*.[cC][cC]' \) \
    -print0 | xargs -0r grep ${1+"$@"}

That's what I use when doing things with global rammification.  I call it


On Thu, 5 Mar 1998, Rasmus Lerdorf wrote:

> > > +1 on the move and rename
> > 
> > +1 (see my earlier mail about the same problem, some days ago)
> Ok, but this still isn't easy to do.  In conf.h we include os.h right near
> the top.  I question the whole concept of os.h, but I assume I am missing
> something basic here.  Regardless, since I assume that this dl abstraction
> needs to be done in os.h, all the dl stuff needs to detected properly
> before the abstraction defines in os.h.  Since os.h is included before
> conf.h can go through and define HAVE_DLFCN_H for the various operating
> systems, we are out of luck.  To move this dl abstraction to conf.h, we
> would basically just have a block near the end of conf.h with:
> #ifdef WIN32
> #define os_dl_module_handle_type HINSTANCE
> #define os_dl_load(l)   LoadLibraryEx(l,NULL,LOAD_WITH_ALTERED_SEARCH_PATH)
> #define os_dl_unload(l) FreeLibrary(l)
> #define os_dl_sym(h,s)  GetProcAddress(h,s)
> #define os_dl_error()   ""  /* for now */
> #else
> # define os_dl_module_handle_type void *
> # define os_dl_load(l)   dlopen(l, RTLD_NOW)
> # define os_dl_unload(l) dlclose(l)
> # define os_dl_sym(h,s)  dlsym(h,s)
> # define os_dl_error()   dlerror()
> #endif
> If we had this, we could do the DLFCN checks in conf.h somewhere above
> this block.  But doing this invalidates the entire existence of the os.h
> files.  We might as well move the entire contents of the various os.h
> files into conf.h and ifdef everything appropriately.
> Or alternatively, all of conf.h should be moved into os.h.  All the
> various checks for different brands of Unix should be in the os/unix/os.h
> file, for example.
> The way we have repeated checks for the same thing in the two files right
> now seems redundant.
> -Rasmus

View raw message