httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@lnd.com>
Subject RE: cvs commit: apache-2.0/src/lib/apr/misc/win32 start.c
Date Thu, 13 Apr 2000 18:01:20 GMT
> From: Greg Stein [mailto:gstein@lyra.org]
> Sent: Thursday, April 13, 2000 12:50 PM
> 
> On 13 Apr 2000 stoddard@locus.apache.org wrote:
> >...
> >   Log:
> >   Win32: Add code to perform latebinding on functions that may
> >   not exist on all levels of Windows where Apache runs. This
> >   is needed to allow Apache to start-up on Win95/98. All calls
> >   to non portable functions should be protected with
> >   ap_oslevel checks to prevent runtime segfaults.
> >...
> >   @@ -165,6 +165,54 @@
> >    } ap_oslevel_e;
> >    
> >    
> >   +typedef enum {
> >   +    DLL_WINBASEAPI = 0,    // kernel32 From WinBase.h
> >   +    DLL_WINADVAPI = 1,     // advapi32 From WinBase.h
> >   +    DLL_WINSOCKAPI = 2,    // mswsock  From WinSock.h
> >   +    DLL_WINSOCK2API = 3,   // ws2_32   From WinSock2.h
> >   +    DLL_defined = 4        // must define as last idx_ + 1
> >   +} ap_dlltoken_e;
> >   +
> >   +FARPROC LoadLateDllFunc(ap_dlltoken_e fnLib, char 
> *fnName, int ordinal);
> >   +
> >   +/* The LateFunctionName call WILL fault if the function 
> cannot be loaded */
> >   +
> >   +#define DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, 
> fn, ord, args, names) \
> >   +    typedef rettype (calltype *fpt##fn) args; \
> >   +    static fpt##fn pfn##fn; \
> 
> For safety, shouldn't this be initialized to NULL?

Yes, it can, although as I said, initialization sequences of 
statics got awfully strange in the c++ original code.

Commit it:  static fpt##fn pfn##fn = NULL;

> 
> >...
> >   +/* This is the helper code to resolve late bound entry points 
> >   + * missing from one or more releases of the Win32 API
> >   + */
> >   +
> >   +static char *lateDllName[DLL_defined] = {
> >   +    "kernel32", "advapi32", "mswsock",  "ws2_32"  };
> 
> This could be "const char * const", right?

Should work... I'll test it.

Mime
View raw message