You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Curt Arnold <ca...@apache.org> on 2007/05/01 17:11:04 UTC

apr-util/misc/apr_thread_pool.c compile failure in VC6

apr_thread_pool.c did not appear in the VC6 project in 1.2.8, but has  
been added in the SVN HEAD and it fails to compile under VC6 in debug  
mode due to a C++ style variable declaration.  The following change  
fixes the compile error.


Index: apr_thread_pool.c
===================================================================
--- apr_thread_pool.c   (revision 534087)
+++ apr_thread_pool.c   (working copy)
@@ -595,6 +595,7 @@

static void wait_on_busy_threads(apr_thread_pool_t * me, void *owner)
{
+    apr_os_thread_t *os_thread;
      struct apr_thread_list_elt *elt;
      apr_thread_mutex_lock(me->lock);
      elt = APR_RING_FIRST(me->busy_thds);
@@ -605,7 +606,6 @@
          }
#ifndef NDEBUG
          /* make sure the thread is not the one calling tasks_cancel */
-        apr_os_thread_t *os_thread;
          apr_os_thread_get(&os_thread, elt->thd);
#ifdef WIN32
          /* hack for apr win32 bug */

Re: apr-util/misc/apr_thread_pool.c compile failure in VC6

Posted by Curt Arnold <ca...@apache.org>.
On May 1, 2007, at 10:21 AM, Erik Huelsmann wrote:

> On 5/1/07, Curt Arnold <ca...@apache.org> wrote:
>> apr_thread_pool.c did not appear in the VC6 project in 1.2.8, but has
>> been added in the SVN HEAD and it fails to compile under VC6 in debug
>> mode due to a C++ style variable declaration.  The following change
>> fixes the compile error.
>
> Shouldn't the moved variable be in conditionals too? This will
> introduce a warning when *not* compiling with NDEBUG, right?
>
> bye,
>
> Erik.
>

My bad, Davi did it right in his patch for this issue: http:// 
issues.apache.org/bugzilla/show_bug.cgi?id=42294.


Re: apr-util/misc/apr_thread_pool.c compile failure in VC6

Posted by Erik Huelsmann <eh...@gmail.com>.
On 5/1/07, Curt Arnold <ca...@apache.org> wrote:
> apr_thread_pool.c did not appear in the VC6 project in 1.2.8, but has
> been added in the SVN HEAD and it fails to compile under VC6 in debug
> mode due to a C++ style variable declaration.  The following change
> fixes the compile error.

Shouldn't the moved variable be in conditionals too? This will
introduce a warning when *not* compiling with NDEBUG, right?

bye,

Erik.

> Index: apr_thread_pool.c
> ===================================================================
> --- apr_thread_pool.c   (revision 534087)
> +++ apr_thread_pool.c   (working copy)
> @@ -595,6 +595,7 @@
>
> static void wait_on_busy_threads(apr_thread_pool_t * me, void *owner)
> {
> +    apr_os_thread_t *os_thread;
>      struct apr_thread_list_elt *elt;
>      apr_thread_mutex_lock(me->lock);
>      elt = APR_RING_FIRST(me->busy_thds);
> @@ -605,7 +606,6 @@
>          }
> #ifndef NDEBUG
>          /* make sure the thread is not the one calling tasks_cancel */
> -        apr_os_thread_t *os_thread;
>          apr_os_thread_get(&os_thread, elt->thd);
> #ifdef WIN32
>          /* hack for apr win32 bug */
>