Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 95717 invoked by uid 500); 3 Jun 2001 17:57:42 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 95706 invoked from network); 3 Jun 2001 17:57:41 -0000 Message-ID: <3B1A7A8A.1E2CCABA@algroup.co.uk> Date: Sun, 03 Jun 2001 18:57:30 +0100 From: Ben Laurie X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: "William A. Rowe, Jr." Cc: ChristianGross@yahoo.de, dev@apr.apache.org Subject: Re: [PATCH] Type conversion needed for C++ References: <09d901c0e619$3b8cfbc0$94c0b0d0@roweclan.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N "William A. Rowe, Jr." wrote: > > I believe this would break type saftey. These are very carefully constructed to > ensure that the proper hook fn is registered for the appropriate hook. In fact, it won't break type safety (there was none in the first place in this statement, so it can't). If it was an issue, we could always wrap it with a #ifdef cplusplus (or whatever that manifest constant is). But in this case it isn't, so the patch is fine by me. Cheers, Ben. > I'll take a look at your patch later today and see what (if) it breaks anything, > or if we were simply missing the "C" namespace wrappers. > > ----- Original Message ----- > From: "Christian Gross" > Sent: Saturday, May 26, 2001 1:33 PM > > I was playing around with hooks and noticed that there is a problem > with using hooks on C++. The problem was that C++ does not allow a > type conversion without a type cast. Following is the fix > > --------------------------------------------------------------- > --- c:/httpd2_16/srclib/apr-util/include/apr_hooks.h Wed Apr 4 > 01:35:46 2001 > +++ c:/httpd/srclib/apr-util/include/apr_hooks.h Sat May 26 > 14:21:58 2001 > @@ -98,7 +98,7 @@ > > _hooks.link_##name=apr_array_make(apr_global_hook_pool,1,sizeof(ns##_LINK_##name##_t)); > \ > apr_hook_sort_register(#name,&_hooks.link_##name); \ > } \ > - pHook=apr_array_push(_hooks.link_##name); \ > + pHook=(ns##_LINK_##name##_t *)apr_array_push(_hooks.link_##name); > \ > pHook->pFunc=pf; \ > pHook->aszPredecessors=aszPre; \ > pHook->aszSuccessors=aszSucc; \ -- http://www.apache-ssl.org/ben.html "There is no limit to what a man can do or how far he can go if he doesn't mind who gets the credit." - Robert Woodruff