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

[PATCH] Fix JavaHL compile error with VS2005

From: Jens Peters <jpeters7677_at_gmx.de>
Date: 2006-01-08 22:34:36 CET

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;

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

Received on Sun Jan 8 22:35:33 2006

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