Author: rhuijben
Date: Fri Jun 3 12:10:49 2011
New Revision: 1131007
URL: http://svn.apache.org/viewvc?rev=1131007&view=rev
Log:
Remove a Windows specific build time dependency on the apr sourcecode from
libsvn_subr.
* subversion/libsvn_subr/nls.c
(includes): Remove include of apr private header.
(svn_nls_init): Use dirent functions for local path processing and use a
Windows '98+ function (we require 2000+) to do the UTF8 conversion instead
of an apr private function.
Modified:
subversion/trunk/subversion/libsvn_subr/nls.c
Modified: subversion/trunk/subversion/libsvn_subr/nls.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/nls.c?rev=1131007&r1=1131006&r2=1131007&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/nls.c (original)
+++ subversion/trunk/subversion/libsvn_subr/nls.c Fri Jun 3 12:10:49 2011
@@ -39,15 +39,6 @@
#include "svn_private_config.h"
-#ifdef WIN32
-/* FIXME: We're using an internal APR header here, which means we
- have to build Subversion with APR sources. This being Win32-only,
- that should be fine for now, but a better solution must be found in
- combination with issue #850. */
-#include <arch/win32/apr_arch_utf8.h>
-#endif
-
-
svn_error_t *
svn_nls_init(void)
{
@@ -102,11 +93,11 @@ svn_nls_init(void)
{
outbytes = outlength = 3 * (inwords + 1);
utf8_path = apr_palloc(pool, outlength);
- apr_err = apr_conv_ucs2_to_utf8(ucs2_path, &inwords,
- utf8_path, &outbytes);
- if (!apr_err && (inwords > 0 || outbytes == 0))
- apr_err = APR_INCOMPLETE;
- if (apr_err)
+
+ outbytes = WideCharToMultiByte(CP_UTF8, 0, ucs2_path, inwords,
+ utf8_path, outbytes, NULL, NULL);
+
+ if (outbytes == 0)
{
err = svn_error_createf(apr_err, NULL,
_("Can't convert module path "
@@ -116,12 +107,12 @@ svn_nls_init(void)
else
{
utf8_path[outlength - outbytes] = '\0';
- internal_path = svn_path_internal_style(utf8_path, pool);
+ internal_path = svn_dirent_internal_style(utf8_path, pool);
/* get base path name */
- internal_path = svn_path_dirname(internal_path, pool);
- internal_path = svn_path_join(internal_path,
- SVN_LOCALE_RELATIVE_PATH,
- pool);
+ internal_path = svn_dirent_dirname(internal_path, pool);
+ internal_path = svn_dirent_join(internal_path,
+ SVN_LOCALE_RELATIVE_PATH,
+ pool);
bindtextdomain(PACKAGE_NAME, internal_path);
}
}