Hi Ben,
Ben Reser wrote:
>On Wed, Mar 17, 2004 at 12:57:33PM +0100, Patrick Mayweg wrote:
>
>
>>Hi,
>>the problem with using the non standard types "long long" and "unsigned
>>long long" happens also to be in subversion/bindings/swig/swigutil_pl.c.
>>This patch replace all the system dependend types and printf format
>>strings with the apr types and macros.
>>[[
>>* swigutil.c (svn_swig_pl_callback_thunk)
>> replace the non standard types and printf format string with their
>>apr counterparts
>>]]
>>
>>Index: swigutil_pl.c
>>===================================================================
>>--- swigutil_pl.c (revision 9065)
>>+++ swigutil_pl.c (working copy)
>>@@ -312,14 +312,14 @@
>> * it available as a string. If not then perl will convert
>> * it to an IV for us. So this handles the problem gracefully */
>> c = malloc(30);
>>- snprintf(c,30,"%lld",va_arg(ap, long long));
>>+ snprintf(c,30,"%" APR_INT64_T_FMT,va_arg(ap, apr_int64_t));
>> XPUSHs(sv_2mortal(newSVpv(c, 0)));
>> free(c);
>> break;
>>
>> case 'U': /* unsigned long long */
>> c = malloc(30);
>>- snprintf(c,30,"%llu",va_arg(ap, unsigned long long));
>>+ snprintf(c,30,"%"APR_INT64_T_FMT,va_arg(ap, apr_uint64_t));
>> XPUSHs(sv_2mortal(newSVpv(c, 0)));
>> free(c);
>> break;
>>
>>
>
>I need to seriously sit down and rework this code. I did a little fixup
>on it to get around int vs long sizes but I really should handle apr
>types better. I think there may be cases where we're actually passing C
>types into this function and sometimes apr types. So before I make this
>change I want to actually sit down and track all of these down and look
>at them. I also want to update the documentation too.
>
>
>
Please remember that "long long" is not portable. A 64bit integer can be
anything from "long", "long long" or "__int64" depending on your compiler.
I have another question. After appling the above patch, the build stop
because swig is looking for "delta_editor.hi", which I did not find. Do
you have any idea where that may be ?
Regards,
Patrick
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Mar 18 07:26:07 2004