apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <ad...@rowe-clan.net>
Subject Re: [PATCH] Type conversion needed for C++
Date Sat, 26 May 2001 19:19:25 GMT
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.

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" <ChristianGross@yahoo.de>
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; \






Mime
View raw message