httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ras...@lerdorf.on.ca (Rasmus Lerdorf)
Subject Re: [PATCH] HAS_DLFCN -> HAVE_DLFCN_H 1
Date Fri, 06 Mar 1998 02:27:11 GMT
> > +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


Mime
View raw message