You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Alex Waugh <al...@alexwaugh.com> on 2006/09/07 20:48:00 UTC

[PATCH] Fix compile when DSOs not available

Hi

On platforms where APR_HAS_DSO is not defined, Subversion no longer
compiles. This patch fixes it.

Alex


[[[
Fix compile error when APR_HAS_DSO is not defined.

* subversion/include/svn_dso.h,
  subversion/libsvn_subr/dso.c
  (svn_dso_load): Only provide the function when APR_HAS_DSO is defined.
]]]


Index: subversion/include/svn_dso.h
===================================================================
--- subversion/include/svn_dso.h	(revision 21377)
+++ subversion/include/svn_dso.h	(working copy)
@@ -49,6 +49,7 @@
  */
 void svn_dso_initialize(void);
 
+#if APR_HAS_DSO
 /**
  * Attempt to load @a libname, returning it in @a dso.
  *
@@ -64,6 +65,8 @@
  */
 svn_error_t *svn_dso_load(apr_dso_handle_t **dso, const char *libname);
 
+#endif
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
Index: subversion/libsvn_subr/dso.c
===================================================================
--- subversion/libsvn_subr/dso.c	(revision 21377)
+++ subversion/libsvn_subr/dso.c	(working copy)
@@ -56,6 +56,8 @@
   dso_cache = apr_hash_make(dso_pool);
 }
 
+#if APR_HAS_DSO
+
 svn_error_t *
 svn_dso_load(apr_dso_handle_t **dso, const char *fname)
 {
@@ -123,3 +125,4 @@
 
   return SVN_NO_ERROR;
 }
+#endif

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

Re: [PATCH] Fix compile when DSOs not available

Posted by Michael Sinz <Mi...@sinz.org>.
On 9/13/06, Garrett Rooney <ro...@electricjellyfish.net> wrote:
> On 9/12/06, Daniel Rall <dl...@collab.net> wrote:
>
> > Our other uses of svn_dso_load() and apr_dso_handle_t in fs-loader.c
> > and ra_loader.c already gate it in "#if APR_HAS_DSO" checks.  I've
> > committed Alex's patch in r21473 (with some very minor stylistic
> > tweaks), and nominated it for backport to the 1.4.x line.
> >
> > An alternate approach which returns something like APR_ENOTIMPL would
> > need to further insulate svn_dso.h from APR's #if/#ifdef's.
>
> Agreed.  In retrospect this patch seems like the best solution.
> Thanks for checking it in Dan.

Also a thankyou and hope for backport as this is basically the
same patch I was about to send to fix the static build option.

(For when you really want to build a fully statically linked SVN client)

-- 
Michael Sinz               Technology and Engineering Director/Consultant
"Starting Startups"                          mailto:Michael.Sinz@sinz.org
My place on the web                      http://www.sinz.org/Michael.Sinz

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

Re: [PATCH] Fix compile when DSOs not available

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 9/12/06, Daniel Rall <dl...@collab.net> wrote:

> Our other uses of svn_dso_load() and apr_dso_handle_t in fs-loader.c
> and ra_loader.c already gate it in "#if APR_HAS_DSO" checks.  I've
> committed Alex's patch in r21473 (with some very minor stylistic
> tweaks), and nominated it for backport to the 1.4.x line.
>
> An alternate approach which returns something like APR_ENOTIMPL would
> need to further insulate svn_dso.h from APR's #if/#ifdef's.

Agreed.  In retrospect this patch seems like the best solution.
Thanks for checking it in Dan.

-garrett

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

Re: [PATCH] Fix compile when DSOs not available

Posted by Daniel Rall <dl...@collab.net>.
On Tue, 12 Sep 2006, Alex Waugh wrote:

> "Garrett Rooney" <ro...@electricjellyfish.net> wrote:
> 
> > On 9/7/06, Alex Waugh <al...@alexwaugh.com> wrote:
> > > Hi
> > >
> > > On platforms where APR_HAS_DSO is not defined, Subversion no longer
> > > compiles. This patch fixes it.
> > 
> > Interesting.  What platform is this, just out of curiosity?
> 
> RISC OS
> 
> > I'm not sure if the patch is entirely correct...  Should we really
> > just not have svn_dso_load, or should we just make it return an
> > APR_ENOTIMPL error?
> 
> The problem is that the apr_dso_handle_t type is not defined unless
> APR_HAS_DSO is set, so the compiler falls over on the function
> prototype as well as the actual code.

Our other uses of svn_dso_load() and apr_dso_handle_t in fs-loader.c
and ra_loader.c already gate it in "#if APR_HAS_DSO" checks.  I've
committed Alex's patch in r21473 (with some very minor stylistic
tweaks), and nominated it for backport to the 1.4.x line.

An alternate approach which returns something like APR_ENOTIMPL would
need to further insulate svn_dso.h from APR's #if/#ifdef's.

Re: [PATCH] Fix compile when DSOs not available

Posted by Alex Waugh <al...@alexwaugh.com>.
"Garrett Rooney" <ro...@electricjellyfish.net> wrote:

> On 9/7/06, Alex Waugh <al...@alexwaugh.com> wrote:
> > Hi
> >
> > On platforms where APR_HAS_DSO is not defined, Subversion no longer
> > compiles. This patch fixes it.
> 
> Interesting.  What platform is this, just out of curiosity?

RISC OS

> I'm not sure if the patch is entirely correct...  Should we really
> just not have svn_dso_load, or should we just make it return an
> APR_ENOTIMPL error?

The problem is that the apr_dso_handle_t type is not defined unless
APR_HAS_DSO is set, so the compiler falls over on the function
prototype as well as the actual code.

Alex

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

Re: [PATCH] Fix compile when DSOs not available

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 9/7/06, Alex Waugh <al...@alexwaugh.com> wrote:
> Hi
>
> On platforms where APR_HAS_DSO is not defined, Subversion no longer
> compiles. This patch fixes it.

Interesting.  What platform is this, just out of curiosity?

I'm not sure if the patch is entirely correct...  Should we really
just not have svn_dso_load, or should we just make it return an
APR_ENOTIMPL error?

=garrett

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