apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apr/misc/unix start.c
Date Wed, 06 Jun 2001 17:19:07 GMT
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();
   }
  
  
  

Mime
View raw message