You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Jens Peters <jp...@gmx.de> on 2006/01/08 21:34:36 UTC

[PATCH] Fix JavaHL compile error with VS2005

Hello,

Please apply this patch and I would also ask to backport it to the 1.3.x
line, because otherwise compiling JavaHL with VS2005 results in a casting
error. The reasons therefore are (according to _the_ Stefan Kueng, thanks
again for the really good explanation):

"The reason VS2005 can't cast that value is twofold:
1. the cast isn't necessary for *.c files, but JNIUtil is a cpp file. In 
C++ casts are more strict.
2. VS2005 now has 'treat wchar_t as Built-in Type' enabled by default, which
was disabled in VS.NET2003."

(I'm resending this patch with a better description, the original message
was http://svn.haxx.se/dev/archive-2006-01/0042.shtml)



[[[
Fix JavaHL compile error with VS2005.

* subversion/bindings/java/javahl/native/JNIUtil.cpp
  Cast 'ucs2_path' to 'apr_wchar_t *' to prevent casting error in VS2005

]]]


Index: subversion/bindings/java/javahl/native/JNIUtil.cpp
===================================================================
--- subversion/bindings/java/javahl/native/JNIUtil.cpp	(revision 18015)
+++ 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;

Re: [PATCH] Fix JavaHL compile error with VS2005

Posted by Daniel Rall <dl...@collab.net>.
On Tue, 10 Jan 2006, Jens Peters wrote:

> > 
> > Thanks, Jens.  I've committed a patch based on this one 
> > (const, extra space after cast type) to trunk in r18032, and 
> > nominated that change for backport to 1.3.1.
> > 
> 
> Thanks a lot for picking this up, however after reverting my patch and
> backporting r18032 into my wc (official 1.3.0 tag) the compiler complains
> about the 'underscore' after the '*'. Was that intentional? Shoudn't that be
> just a 'space' or nothing at all?

Yeah, thanks for mentioning that, Jens.  Peter Lundblad also picked up
on that typo, and I subsequently fixed it.
-- 

Daniel Rall

RE: [PATCH] Fix JavaHL compile error with VS2005

Posted by Jens Peters <jp...@gmx.de>.
> 
> Thanks, Jens.  I've committed a patch based on this one 
> (const, extra space after cast type) to trunk in r18032, and 
> nominated that change for backport to 1.3.1.
> 

Thanks a lot for picking this up, however after reverting my patch and
backporting r18032 into my wc (official 1.3.0 tag) the compiler complains
about the 'underscore' after the '*'. Was that intentional? Shoudn't that be
just a 'space' or nothing at all?

Greeting,
Jens

Re: [PATCH] Fix JavaHL compile error with VS2005

Posted by Daniel Rall <dl...@collab.net>.
On Sun, 08 Jan 2006, Jens Peters wrote:

> Hello,
> 
> Please apply this patch and I would also ask to backport it to the 1.3.x
> line, because otherwise compiling JavaHL with VS2005 results in a casting
> error. The reasons therefore are (according to _the_ Stefan Kueng, thanks
> again for the really good explanation):

Thanks, Jens.  I've committed a patch based on this one (const, extra
space after cast type) to trunk in r18032, and nominated that change
for backport to 1.3.1.

> "The reason VS2005 can't cast that value is twofold:
> 1. the cast isn't necessary for *.c files, but JNIUtil is a cpp file. In 
> C++ casts are more strict.
> 2. VS2005 now has 'treat wchar_t as Built-in Type' enabled by default, which
> was disabled in VS.NET2003."
> 
> (I'm resending this patch with a better description, the original message
> was http://svn.haxx.se/dev/archive-2006-01/0042.shtml)
...
-- 

Daniel Rall