[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: [SVN1.3] javahl compile problem with VS2005

From: Jens Peters <jpeters7677_at_gmx.de>
Date: 2006-01-03 15:54:50 CET

> I tried my best to compile the whole subversion-1.3/apache-2.0.55 package
with VS2005.
> I worked out some minor problem quite easy (eg. the buildsystem forgot to
link
> libsvn_ra_dav with libneon.lib; I got a lot of "unresolved external symbol
error"
> in the first place) but while compiling javahl I encounterd (it seems so
to me) a
> real error in combination with VS2005:

> ..\..\..\subversion\bindings\java\javahl\native\JNIUtil.cpp(197) : error
> C2664: 'apr_conv_ucs2_to_utf8' : cannot convert parameter 1 from 'WCHAR
[260]' to 'const apr_wchar_t *'

> I don't know exactly why VS don't want to cast automatically because at
other
> places where apr_conv_ucs2_to_utf8 is used this isn't necessary. But since
the return
> value from apr_palloc (param utf8_path) is casted as well in JNIUtil.cpp
at line 195
> (not at the other apr_conv_ucs2_to_utf8 places!) the following fix seems
correct to me:

> -apr_err = apr_conv_ucs2_to_utf8 (ucs2_path, &inwords,
> - utf8_path, &outbytes);
> +apr_err = apr_conv_ucs2_to_utf8 ((apr_wchar_t *)ucs2_path, &inwords,
> + utf8_path, &outbytes);

> Sorry for not creating a real patchfile, but you repository isn't
available and so I had to use the compressed source file :)

I have attached a real pachfile:

[[[
* subversion/bindings/java/javahl/native/JNIUtil.cpp
  - fixes compile error with VS2005
    'apr_conv_ucs2_to_utf8' : cannot convert parameter 1 from 'WCHAR [260]'
to 'const apr_wchar_t *'
]]]

Index: subversion/bindings/java/javahl/native/JNIUtil.cpp
===================================================================
--- subversion/bindings/java/javahl/native/JNIUtil.cpp (revision 17955)
+++ subversion/bindings/java/javahl/native/JNIUtil.cpp (working copy)
@@ -193,7 +193,7 @@
         inwords = lstrlenW (ucs2_path);
         outbytes = outlength = 3 * (inwords + 1);
         utf8_path = (char *)apr_palloc (pool, outlength);
- apr_err = apr_conv_ucs2_to_utf8 (ucs2_path, &inwords,
+ apr_err = apr_conv_ucs2_to_utf8 ((apr_wchar_t *)ucs2_path,
&inwords,
                                          utf8_path, &outbytes);
         if (!apr_err && (inwords > 0 || outbytes == 0))
           apr_err = APR_INCOMPLETE;

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Tue Jan 3 16:05:17 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.