Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 19485 invoked by uid 500); 13 Apr 2000 18:02:46 -0000 Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Precedence: bulk X-No-Archive: yes Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list new-httpd@apache.org Received: (qmail 19469 invoked from network); 13 Apr 2000 18:02:45 -0000 From: "William A. Rowe, Jr." To: Subject: RE: cvs commit: apache-2.0/src/lib/apr/misc/win32 start.c Date: Thu, 13 Apr 2000 13:01:20 -0500 Message-ID: <000c01bfa572$74e28400$345985d0@corecomm.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 In-reply-to: X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Importance: Normal X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N > 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.