You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2001/06/06 19:19:07 UTC

cvs commit: apr/misc/unix start.c

wrowe       01/06/06 10:19:06

  Modified:    include  apr_general.h
               misc/unix start.c
  Log:
    Solve the linkage issue with a native-C (nonstd convention) declaration
    of apr_terminate (for atexit(apr_terminate), etc), and provide an
    alternate apr_terminate2 only for non-C languages ('pascal' convention.)
  
  Revision  Changes    Path
  1.59      +16 -2     apr/include/apr_general.h
  
  Index: apr_general.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_general.h,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- apr_general.h	2001/05/10 18:06:24	1.58
  +++ apr_general.h	2001/06/06 17:18:58	1.59
  @@ -173,10 +173,24 @@
    * automatically.
    * @tip An APR program must call this function at termination once it 
    *      has stopped using APR services.  The APR developers suggest using
  - *      atexit to ensure this is called.
  + *      atexit to ensure this is called.  When using APR from a language
  + *      other than C that has problems with the calling convention, use
  + *      apr_terminate2() instead.
    * @deffunc void apr_terminate(void)
    */
  -APR_DECLARE(void) apr_terminate(void);
  +APR_DECLARE_NONSTD(void) apr_terminate(void);
  +
  +/**
  + * Tear down any APR internal data structures which aren't torn down 
  + * automatically, same as apr_terminate
  + * @tip An APR program must call either the apr_terminate or apr_terminate2 
  + *      function once it it has finished using APR services.  The APR 
  + *      developers suggest using atexit(apr_terminate) to ensure this is done.
  + *      apr_terminate2 exists to allow non-c language apps to tear down apr, 
  + *      while apr_terminate is recommended from c language applications.
  + * @deffunc void apr_terminate2(void)
  + */
  +APR_DECLARE(void) apr_terminate2(void);
   
   #ifdef __cplusplus
   }
  
  
  
  1.51      +6 -1      apr/misc/unix/start.c
  
  Index: start.c
  ===================================================================
  RCS file: /home/cvs/apr/misc/unix/start.c,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- start.c	2001/04/26 21:29:00	1.50
  +++ start.c	2001/06/06 17:19:03	1.51
  @@ -104,11 +104,16 @@
       return APR_SUCCESS;
   }
   
  -APR_DECLARE(void) apr_terminate(void)
  +APR_DECLARE_NONSTD(void) apr_terminate(void)
   {
       initialized--;
       if (initialized) {
           return;
       }
       apr_pool_alloc_term(global_apr_pool);
  +}
  +
  +APR_DECLARE(void) apr_terminate2(void)
  +{
  +    apr_terminate();
   }
  
  
  

Re: cvs commit: apr/misc/unix start.c

Posted by Greg Stein <gs...@lyra.org>.
On Wed, Jun 06, 2001 at 05:19:07PM -0000, wrowe@apache.org wrote:
> wrowe       01/06/06 10:19:06
> 
>   Modified:    include  apr_general.h
>                misc/unix start.c
>   Log:
>     Solve the linkage issue with a native-C (nonstd convention) declaration
>     of apr_terminate (for atexit(apr_terminate), etc), and provide an
>     alternate apr_terminate2 only for non-C languages ('pascal' convention.)

Which non-c language *cannot* bind to a cdecl function?

Before we go down this path, let's find the requirement. I am suspicious
that there is a language out there which doesn't have cdecl binding
capability today.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/