apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Holsman <I...@cnet.com>
Subject RE: Declaration of apr_terminate() and Win32
Date Mon, 21 May 2001 14:28:33 GMT
Compiling...
generate_index.c
c:\src\apache\httpd-2.0\modules\mod_mbox\generate_index.c(82) : error C2152: 'function' :
pointers to functions with different attributes
c:\src\apache\httpd-2.0\modules\mod_mbox\generate_index.c(82) : warning C4024: 'atexit' :
different types for formal and actual parameter 1

line82: atexit(apr_terminate);

this is the declaration for atexit:
int atexit( void ( __cdecl *func )( void ) );

from apr_general.h
APR_DECLARE(void) apr_terminate(void);
which gets translated to 
void __stdcall apr_terminate(void);

it must be the stdcall thing. I have APR_DECLARE_STATIC defined (as ab does)

> -----Original Message-----
> From: Justin Erenkrantz [mailto:jerenkrantz@ebuilt.com]
> Sent: Sun, May 20, 2001 5:51 PM
> To: dev@apr.apache.org
> Subject: Declaration of apr_terminate() and Win32
> 
> 
> On Fri, May 18, 2001 at 12:16:06PM -0700, Ian Holsman wrote:
> > also... to get generate_index.c to work on a NT box:
> > you'll need to add a 
> > static void terminate(void)
> > {
> >     apr_terminate();
> > }
> > 
> > and change 'atexit' to  atexit(terminate);
> > as apr_terminate doesn't have the correct function definition.
> 
> [This private thread was originally about the mod_mbox's APR 
> standalone 
> program which generates the DBM index files...]
> 
> Ian,
> 
> I had a chance to look at apr_terminate and it seems that APR 
> defines it
> correctly (but again, I only use Unix, so of course, it'd be right).  
> What's the error with apr_terminate and MS's C compiler that you were
> seeing?
> 
> I'm posting this to dev@apr.apache.org in the hopes that 
> someone with a
> Win32 compiler has an idea why apr_terminate can't be 
> directly used with
> atexit().  If it can't be used directly, it seems that the prototype
> should be changed - I think my usage of atexit(apr_terminate) is
> correct, but I might be wrong.  Odd.  -- justin
> 

Mime
View raw message