From: Erik Huelsmann Date: 2005-04-23T21:08:41+09:00 Subject: Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings On 4/22/05, Kouhei Sutou wrote: > Hi, > > In > "Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings" on Wed, 20 Apr 2005 23:23:14 +0900, > Erik Huelsmann wrote: > > > Having taken upon me the task to provide a Windows build for > > Subversion, I run into a problem with the Ruby SWIG bindings. The > > problem is with APR and Ruby Win32 header files though. > > > > Windows does not define pid_t, gid_t or uid_t in any of the system > > headers. Both APR and Ruby *do* define these 3 types: > > Does this patch solve the problem? No, because gid_t an uid_t are defined (conditionally on WIN32) in config.h instead of in win32/win32.h. But I think that although it would be nice to fix the bindings compilation in the short term, this patch does not resolve any of the problems introduced by defining or redefining POSIX standard types. The correct solution would be to define rb_pid_t and friend, then on POSIX systems: typedef pid_t rb_pid_t and on windows (and possibly other non-posix systems) typedef int rb_pid_t But I don't know who to submit a patch to in order to achieve that.... bye, Erik. > > -- > kou > > > Index: subversion/bindings/swig/core.i > =================================================================== > --- subversion/bindings/swig/core.i (revision 14394) > +++ subversion/bindings/swig/core.i (working copy) > @@ -27,6 +27,11 @@ > %include typemaps.i > > %{ > +#ifdef RUBY_WIN32_H > +#undef UIDTYPE > +#undef GIDTYPE > +#undef pid_t > +#endif > #include > #include > > Index: subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h > =================================================================== > --- subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h (revision 14394) > +++ subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h (working copy) > @@ -1,15 +1,15 @@ > #ifndef SVN_SWIG_SWIGUTIL_RB_H > #define SVN_SWIG_SWIGUTIL_RB_H > > -#include > -#include > - > #include > #include > #include > #include > #include > > +#include > +#include > + > #include "svn_types.h" > #include "svn_string.h" > #include "svn_delta.h" > Index: subversion/bindings/swig/svn_client.i > =================================================================== > --- subversion/bindings/swig/svn_client.i (revision 14394) > +++ subversion/bindings/swig/svn_client.i (working copy) > @@ -312,6 +312,12 @@ > > #ifdef SWIGRUBY > %runtime %{ > + #ifdef RUBY_WIN32_H > + #undef UIDTYPE > + #undef GIDTYPE > + #undef pid_t > + #endif > + > #include > #include >