You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Paul Smedley <pa...@smedley.id.au> on 2010/06/27 09:58:15 UTC

[Patch] - Fix compilation of direct_uri-test.c on OS/2

[[[
Fix compilation of direct_uri-test.c on OS/2

* subversion/tests/libsvn_subr/dirent_uri-test.c : add define of getdcwd 
as _getdcwd for __OS2__ as well as _MSC_VER
]]]

RE: [Patch] - Fix compilation of direct_uri-test.c on OS/2

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: Eric Zeitler [mailto:eric.zeitler@gmail.com]
> Sent: vrijdag 23 juli 2010 1:48
> To: Bert Huijben
> Cc: dev@subversion.apache.org
> Subject: Re: [Patch] - Fix compilation of direct_uri-test.c on OS/2
> 
>  On 7/22/2010 4:02 PM, Bert Huijben wrote:
> >
> >> -----Original Message-----
> >> From: Eric Zeitler [mailto:eric.zeitler@gmail.com]
> >> Sent: donderdag 22 juli 2010 23:50
> >> To: dev@subversion.apache.org
> >> Subject: Re: [Patch] - Fix compilation of direct_uri-test.c on OS/2
> >>
> >> Matthew Bentham <mjb67 <at> artvps.com> writes:
> >>
> >>> On 28/06/2010 10:29, Bert Huijben wrote:
> >>>>
> >>>>> -----Original Message-----
> >>>>> From: Julian Foad [mailto:julian.foad <at> wandisco.com]
> >>>>> Sent: maandag 28 juni 2010 10:48
> >>>>> To: Paul Smedley
> >>>>> Cc: dev <at> subversion.apache.org
> >>>>> Subject: Re: [Patch] - Fix compilation of direct_uri-test.c on
> >> OS/2
> >>>>> On Sun, 2010-06-27, Paul Smedley wrote:
> >>>>>> [[[
> >>>>>> Fix compilation of direct_uri-test.c on OS/2
> >>>>>>
> >>>>>> * subversion/tests/libsvn_subr/dirent_uri-test.c : add define of
> >> getdcwd
> >>>>>> as _getdcwd for __OS2__ as well as _MSC_VER
> >>>>>> ]]]
> >>>>> Hi Paul.  To see if there were other similar places, I searched
> >> for
> >>>>> _MSC_VER and found two more.  Can you confirm whether the
> >> following is a
> >>>>> good patch?
> >>>> _MSC_VER is a check for the Microsoft compiler (and it's compiler
> >> specific
> >> include files; we check for
> >>> Windows in a different way), __OS2__ checks for a platform.
> >>>> Maybe we should just try to move this to platform specific checks.
> >>>>
> >>>> The only problem is that I have no way to confirm if this function
> >> is
> >> available under the less common
> >>> cygwin/mingw environments. Borland C++ is most likely compatible
> with
> >> the
> >> Microsoft compilers.
> >>>> 	Bert
> >>>>
> >>> _getdcwd does not exist on the cygwin platform (which is a Unix
> >>> platform), but _getdcwd and _wgetdcwd are available under mingw32
> >> (which
> >>> is a Windows platform) through direct.h.
> >>>
> >>> Matthew
> >>>
> >>>
> >> I have created a patch to fix this very issue for Cygwin.
> > This patch disables all C:/ like path support in Subversion if you
> compile
> > it for Cygwin. I would guess that is not what you intended?
> >
> > We probably need a specific patch to target that function instead of
> just
> > switching all path handling to unix-like.
> >
> > 	Bert
> >
> Cygwin, by default, gives a big scary warning if you use DOS paths so I
> figure anyone who really needs it can use cypath.  I don't think anyone
> was depending on this as it didn't even compile before.

This specific define you are patching was added on trunk a few weeks ago,
until then the specific testcase was only enabled for Microsoft compilers. 

I think it is hard to tell the real number of users of a specific
distribution from the number of users compiling current trunk themselves.
(Especially with all the warnings around the current working copy state)

	Bert

Re: [Patch] - Fix compilation of direct_uri-test.c on OS/2

Posted by Eric Zeitler <er...@gmail.com>.
 On 7/22/2010 4:02 PM, Bert Huijben wrote:
>
>> -----Original Message-----
>> From: Eric Zeitler [mailto:eric.zeitler@gmail.com]
>> Sent: donderdag 22 juli 2010 23:50
>> To: dev@subversion.apache.org
>> Subject: Re: [Patch] - Fix compilation of direct_uri-test.c on OS/2
>>
>> Matthew Bentham <mjb67 <at> artvps.com> writes:
>>
>>> On 28/06/2010 10:29, Bert Huijben wrote:
>>>>
>>>>> -----Original Message-----
>>>>> From: Julian Foad [mailto:julian.foad <at> wandisco.com]
>>>>> Sent: maandag 28 juni 2010 10:48
>>>>> To: Paul Smedley
>>>>> Cc: dev <at> subversion.apache.org
>>>>> Subject: Re: [Patch] - Fix compilation of direct_uri-test.c on
>> OS/2
>>>>> On Sun, 2010-06-27, Paul Smedley wrote:
>>>>>> [[[
>>>>>> Fix compilation of direct_uri-test.c on OS/2
>>>>>>
>>>>>> * subversion/tests/libsvn_subr/dirent_uri-test.c : add define of
>> getdcwd
>>>>>> as _getdcwd for __OS2__ as well as _MSC_VER
>>>>>> ]]]
>>>>> Hi Paul.  To see if there were other similar places, I searched
>> for
>>>>> _MSC_VER and found two more.  Can you confirm whether the
>> following is a
>>>>> good patch?
>>>> _MSC_VER is a check for the Microsoft compiler (and it's compiler
>> specific
>> include files; we check for
>>> Windows in a different way), __OS2__ checks for a platform.
>>>> Maybe we should just try to move this to platform specific checks.
>>>>
>>>> The only problem is that I have no way to confirm if this function
>> is
>> available under the less common
>>> cygwin/mingw environments. Borland C++ is most likely compatible with
>> the
>> Microsoft compilers.
>>>> 	Bert
>>>>
>>> _getdcwd does not exist on the cygwin platform (which is a Unix
>>> platform), but _getdcwd and _wgetdcwd are available under mingw32
>> (which
>>> is a Windows platform) through direct.h.
>>>
>>> Matthew
>>>
>>>
>> I have created a patch to fix this very issue for Cygwin.
> This patch disables all C:/ like path support in Subversion if you compile
> it for Cygwin. I would guess that is not what you intended?
>
> We probably need a specific patch to target that function instead of just
> switching all path handling to unix-like.
>
> 	Bert
>
Cygwin, by default, gives a big scary warning if you use DOS paths so I
figure anyone who really needs it can use cypath.  I don't think anyone
was depending on this as it didn't even compile before.

RE: [Patch] - Fix compilation of direct_uri-test.c on OS/2

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: Eric Zeitler [mailto:eric.zeitler@gmail.com]
> Sent: donderdag 22 juli 2010 23:50
> To: dev@subversion.apache.org
> Subject: Re: [Patch] - Fix compilation of direct_uri-test.c on OS/2
> 
> Matthew Bentham <mjb67 <at> artvps.com> writes:
> 
> >
> > On 28/06/2010 10:29, Bert Huijben wrote:
> > >
> > >
> > >> -----Original Message-----
> > >> From: Julian Foad [mailto:julian.foad <at> wandisco.com]
> > >> Sent: maandag 28 juni 2010 10:48
> > >> To: Paul Smedley
> > >> Cc: dev <at> subversion.apache.org
> > >> Subject: Re: [Patch] - Fix compilation of direct_uri-test.c on
> OS/2
> > >>
> > >> On Sun, 2010-06-27, Paul Smedley wrote:
> > >>> [[[
> > >>> Fix compilation of direct_uri-test.c on OS/2
> > >>>
> > >>> * subversion/tests/libsvn_subr/dirent_uri-test.c : add define of
> getdcwd
> > >>> as _getdcwd for __OS2__ as well as _MSC_VER
> > >>> ]]]
> > >>
> > >> Hi Paul.  To see if there were other similar places, I searched
> for
> > >> _MSC_VER and found two more.  Can you confirm whether the
> following is a
> > >> good patch?
> > >
> > > _MSC_VER is a check for the Microsoft compiler (and it's compiler
> specific
> include files; we check for
> > Windows in a different way), __OS2__ checks for a platform.
> > >
> > > Maybe we should just try to move this to platform specific checks.
> > >
> > > The only problem is that I have no way to confirm if this function
> is
> available under the less common
> > cygwin/mingw environments. Borland C++ is most likely compatible with
> the
> Microsoft compilers.
> > >
> > > 	Bert
> > >
> >
> > _getdcwd does not exist on the cygwin platform (which is a Unix
> > platform), but _getdcwd and _wgetdcwd are available under mingw32
> (which
> > is a Windows platform) through direct.h.
> >
> > Matthew
> >
> >
> 
> I have created a patch to fix this very issue for Cygwin.

This patch disables all C:/ like path support in Subversion if you compile
it for Cygwin. I would guess that is not what you intended?

We probably need a specific patch to target that function instead of just
switching all path handling to unix-like.

	Bert

Re: [Patch] - Fix compilation of direct_uri-test.c on OS/2

Posted by Eric Zeitler <er...@gmail.com>.
Matthew Bentham <mjb67 <at> artvps.com> writes:

> 
> On 28/06/2010 10:29, Bert Huijben wrote:
> >
> >
> >> -----Original Message-----
> >> From: Julian Foad [mailto:julian.foad <at> wandisco.com]
> >> Sent: maandag 28 juni 2010 10:48
> >> To: Paul Smedley
> >> Cc: dev <at> subversion.apache.org
> >> Subject: Re: [Patch] - Fix compilation of direct_uri-test.c on OS/2
> >>
> >> On Sun, 2010-06-27, Paul Smedley wrote:
> >>> [[[
> >>> Fix compilation of direct_uri-test.c on OS/2
> >>>
> >>> * subversion/tests/libsvn_subr/dirent_uri-test.c : add define of getdcwd
> >>> as _getdcwd for __OS2__ as well as _MSC_VER
> >>> ]]]
> >>
> >> Hi Paul.  To see if there were other similar places, I searched for
> >> _MSC_VER and found two more.  Can you confirm whether the following is a
> >> good patch?
> >
> > _MSC_VER is a check for the Microsoft compiler (and it's compiler specific 
include files; we check for
> Windows in a different way), __OS2__ checks for a platform.
> >
> > Maybe we should just try to move this to platform specific checks.
> >
> > The only problem is that I have no way to confirm if this function is 
available under the less common
> cygwin/mingw environments. Borland C++ is most likely compatible with the 
Microsoft compilers.
> >
> > 	Bert
> >
> 
> _getdcwd does not exist on the cygwin platform (which is a Unix 
> platform), but _getdcwd and _wgetdcwd are available under mingw32 (which 
> is a Windows platform) through direct.h.
> 
> Matthew
> 
> 

I have created a patch to fix this very issue for Cygwin.

Index: subversion/libsvn_subr/dirent_uri.c
===================================================================
--- subversion/libsvn_subr/dirent_uri.c (revision 966858)
+++ subversion/libsvn_subr/dirent_uri.c (working copy)
@@ -51,7 +51,7 @@
 #define SVN_PATH_IS_PLATFORM_EMPTY(s,n) ((n) == 1 && (s)[0] == '.')

 /* This check must match the check on top of dirent_uri-tests.c */
-#if defined(WIN32) || defined(__CYGWIN__) || defined(__OS2__)
+#if defined(WIN32) || defined(__OS2__)
 #define SVN_USE_DOS_PATHS
 #endif

Index: subversion/tests/libsvn_subr/dirent_uri-test.c
===================================================================
--- subversion/tests/libsvn_subr/dirent_uri-test.c      (revision 966858)
+++ subversion/tests/libsvn_subr/dirent_uri-test.c      (working copy)
@@ -42,7 +42,7 @@
 #define SVN_EMPTY_PATH ""

 /* This check must match the check on top of dirent_uri.c */
-#if defined(WIN32) || defined(__CYGWIN__) || defined(__OS2__)
+#if defined(WIN32) || defined(__OS2__)
 #define SVN_USE_DOS_PATHS
 #endif



Re: [Patch] - Fix compilation of direct_uri-test.c on OS/2

Posted by Matthew Bentham <mj...@artvps.com>.
On 28/06/2010 10:29, Bert Huijben wrote:
>
>
>> -----Original Message-----
>> From: Julian Foad [mailto:julian.foad@wandisco.com]
>> Sent: maandag 28 juni 2010 10:48
>> To: Paul Smedley
>> Cc: dev@subversion.apache.org
>> Subject: Re: [Patch] - Fix compilation of direct_uri-test.c on OS/2
>>
>> On Sun, 2010-06-27, Paul Smedley wrote:
>>> [[[
>>> Fix compilation of direct_uri-test.c on OS/2
>>>
>>> * subversion/tests/libsvn_subr/dirent_uri-test.c : add define of getdcwd
>>> as _getdcwd for __OS2__ as well as _MSC_VER
>>> ]]]
>>
>> Hi Paul.  To see if there were other similar places, I searched for
>> _MSC_VER and found two more.  Can you confirm whether the following is a
>> good patch?
>
> _MSC_VER is a check for the Microsoft compiler (and it's compiler specific include files; we check for Windows in a different way), __OS2__ checks for a platform.
>
> Maybe we should just try to move this to platform specific checks.
>
> The only problem is that I have no way to confirm if this function is available under the less common cygwin/mingw environments. Borland C++ is most likely compatible with the Microsoft compilers.
>
> 	Bert
>

_getdcwd does not exist on the cygwin platform (which is a Unix 
platform), but _getdcwd and _wgetdcwd are available under mingw32 (which 
is a Windows platform) through direct.h.

Matthew

Re: [Patch] - Fix compilation of direct_uri-test.c on OS/2

Posted by Matthew Bentham <mj...@artvps.com>.
On 28/06/2010 10:29, Bert Huijben wrote:
>
>
>> -----Original Message-----
>> From: Julian Foad [mailto:julian.foad@wandisco.com]
>> Sent: maandag 28 juni 2010 10:48
>> To: Paul Smedley
>> Cc: dev@subversion.apache.org
>> Subject: Re: [Patch] - Fix compilation of direct_uri-test.c on OS/2
>>
>> On Sun, 2010-06-27, Paul Smedley wrote:
>>> [[[
>>> Fix compilation of direct_uri-test.c on OS/2
>>>
>>> * subversion/tests/libsvn_subr/dirent_uri-test.c : add define of getdcwd
>>> as _getdcwd for __OS2__ as well as _MSC_VER
>>> ]]]
>>
>> Hi Paul.  To see if there were other similar places, I searched for
>> _MSC_VER and found two more.  Can you confirm whether the following is a
>> good patch?
>
> _MSC_VER is a check for the Microsoft compiler (and it's compiler specific include files; we check for Windows in a different way), __OS2__ checks for a platform.
>
> Maybe we should just try to move this to platform specific checks.
>
> The only problem is that I have no way to confirm if this function is available under the less common cygwin/mingw environments. Borland C++ is most likely compatible with the Microsoft compilers.
>
> 	Bert
>

_getdcwd does not exist on the cygwin platform (which is a Unix 
platform), but _getdcwd and _wgetdcwd are available under mingw32 (which 
is a Windows platform) through direct.h.

Matthew

RE: [Patch] - Fix compilation of direct_uri-test.c on OS/2

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: Julian Foad [mailto:julian.foad@wandisco.com]
> Sent: maandag 28 juni 2010 10:48
> To: Paul Smedley
> Cc: dev@subversion.apache.org
> Subject: Re: [Patch] - Fix compilation of direct_uri-test.c on OS/2
> 
> On Sun, 2010-06-27, Paul Smedley wrote:
> > [[[
> > Fix compilation of direct_uri-test.c on OS/2
> >
> > * subversion/tests/libsvn_subr/dirent_uri-test.c : add define of getdcwd
> > as _getdcwd for __OS2__ as well as _MSC_VER
> > ]]]
> 
> Hi Paul.  To see if there were other similar places, I searched for
> _MSC_VER and found two more.  Can you confirm whether the following is a
> good patch?

_MSC_VER is a check for the Microsoft compiler (and it's compiler specific include files; we check for Windows in a different way), __OS2__ checks for a platform. 

Maybe we should just try to move this to platform specific checks. 

The only problem is that I have no way to confirm if this function is available under the less common cygwin/mingw environments. Borland C++ is most likely compatible with the Microsoft compilers.

	Bert

Re: [Patch] - Fix compilation of direct_uri-test.c on OS/2

Posted by Julian Foad <ju...@wandisco.com>.
On Sun, 2010-06-27, Paul Smedley wrote:
> [[[
> Fix compilation of direct_uri-test.c on OS/2
> 
> * subversion/tests/libsvn_subr/dirent_uri-test.c : add define of getdcwd 
> as _getdcwd for __OS2__ as well as _MSC_VER
> ]]]

Hi Paul.  To see if there were other similar places, I searched for
_MSC_VER and found two more.  Can you confirm whether the following is a
good patch?

[[[
Fix compilation of direct_uri-test.c on OS/2.

* subversion/tests/libsvn_subr/dirent_uri-test.c,
  subversion/tests/libsvn_subr/target-test.c,
  subversion/tests/svn_test_fs.c
  Define getdcwd as _getdcwd for __OS2__ as well as for _MSC_VER.
]]]

[[[
Index: subversion/tests/libsvn_subr/dirent_uri-test.c
===================================================================
--- subversion/tests/libsvn_subr/dirent_uri-test.c	(revision 958494)
+++ subversion/tests/libsvn_subr/dirent_uri-test.c	(working copy)
@@ -24,7 +24,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__OS2__)
 #include <direct.h>
 #define getcwd _getcwd
 #define getdcwd _getdcwd
Index: subversion/tests/libsvn_subr/target-test.c
===================================================================
--- subversion/tests/libsvn_subr/target-test.c	(revision 958494)
+++ subversion/tests/libsvn_subr/target-test.c	(working copy)
@@ -24,7 +24,7 @@
 #include <apr_general.h>
 
 
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__OS2__)
 #include <direct.h>
 #define getcwd _getcwd
 #else
Index: subversion/tests/svn_test_fs.c
===================================================================
--- subversion/tests/svn_test_fs.c	(revision 958494)
+++ subversion/tests/svn_test_fs.c	(working copy)
@@ -24,7 +24,7 @@
 #include <string.h>
 #include <apr_pools.h>
 
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__OS2__)
 #include <direct.h>
 #define getcwd _getcwd
 #else
]]]

- Julian