On Tue, Nov 24, 2009 at 12:46 PM, Gregg L. Smith <[email protected]> wrote:
> Jeff Trawick wrote:
>>
>> On Mon, Nov 23, 2009 at 6:17 PM,  <[email protected]> wrote:
>>>
>>> Author: trawick
>>> Date: Mon Nov 23 23:17:51 2009
>>> New Revision: 883540
>>>
>>> URL: http://svn.apache.org/viewvc?rev=883540&view=rev
>>
>> There will likely be other issues to discuss about this, but to start
>> with:
>>
>> * you need an extremely recent checkout of apr-1.4.x in order to get
>> apr_global_mutex_lockfile()
>
> VC6 SP6 SDK 2003R2
> VC9 SP1 SDK Included Express
> Checkout APR 1.4 post r883540
>
>> --- httpd/httpd/trunk/server/util_mutex.c  2009/03/26 12:44:48  758613
>> +++ httpd/httpd/trunk/server/util_mutex.c  2009/11/23 23:17:51  883540
>> @@ -31,7 +32,12 @@
>>  #include "httpd.h"
>>  #include "http_main.h"
>>  #include "http_config.h"
>> +#include "http_log.h"
>>  #include "util_mutex.h"
>> +#include "unixd.h"
>> +#ifdef HAVE_UNISTD_H
>> +#include <unistd.h> /* getpid() */
>> +#endif
>
> #include "unixd.h" in the open and anything associated with it is going
> to bring Visual Studio to it's knees.

fixed in r883802

>
> I see this in other places (socache modules at least)
>
> #if AP_NEED_SET_MUTEX_PERMS
> #include "unixd.h"
> #endif
>

yep

>
> and maybe
>
> /* Check for definition of DEFAULT_REL_RUNTIMEDIR */
> #ifndef DEFAULT_REL_RUNTIMEDIR
> #define DEFAULT_DBM_PREFIX   "whatever_it_should_be"
> #else
> #define DEFAULT_DBM_PREFIX DEFAULT_REL_RUNTIMEDIR "whatever"
> #endif
>
> since it is not picking it up from mpm_default.h

I don't follow you on this one

>
> VC6/9 doesn't seem too thrilled with this in core.c
>
> AP_INIT_TAKE2("Mutex", ap_set_mutex, NULL, RSRC_CONF,
>              "mutex (or \"default\") and mechanism"),
>
> VC6 E:\build\httpd-2.3.x-dev\server\core.c(3323) : error C2152:
> 'initializing' : pointers to functions with different attributes
>
> VC9 .\server\core.c(3323) : error C2440: 'initializing' : cannot convert
> from 'const char *(__stdcall *)(cmd_parms *,void *,const char *,const
> char *)' to 'cmd_func'
>
> not quite sure what it is telling me here other than possibly ap_set_mutex
> is not returning a string, not sure.

calling convention incompatibility; I guess the command function
macros have hard-coded a particular calling convention that is
different from our API calling convent (AP_DECLARE())

can you try the attached patch pretty please?

Thanks!
Index: include/util_mutex.h
===================================================================
--- include/util_mutex.h        (revision 883688)
+++ include/util_mutex.h        (working copy)
@@ -99,9 +99,9 @@
                                         const char **mutexfile);
 
 /* private function to process the Mutex directive */
-AP_DECLARE(const char *) ap_set_mutex(cmd_parms *cmd, void *dummy,
-                                      const char *typelist,
-                                      const char *mechfile);
+const char * ap_set_mutex(cmd_parms *cmd, void *dummy,
+                          const char *typelist,
+                          const char *mechfile);
 
 /**
  * option flags for ap_mutex_register(), ap_global_mutex_create(), and
Index: server/util_mutex.c
===================================================================
--- server/util_mutex.c (revision 883802)
+++ server/util_mutex.c (working copy)
@@ -160,8 +160,8 @@
     apr_hash_set(mxcfg_by_type, "default", APR_HASH_KEY_STRING, def);
 }
 
-AP_DECLARE(const char *) ap_set_mutex(cmd_parms *cmd, void *dummy,
-                                      const char *type, const char *mechdir)
+const char * ap_set_mutex(cmd_parms *cmd, void *dummy,
+                          const char *type, const char *mechdir)
 {
     apr_pool_t *p = cmd->pool;
     apr_lockmech_e mech;

Reply via email to