You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rs...@hyperreal.org on 1998/04/19 14:25:23 UTC
cvs commit: apache-1.3/src/os/unix os.c
rse 98/04/19 05:25:22
Modified: src/os/unix os.c
Log:
Avoid warnings for discarded const under some platforms like OSF1 and FreeBSD
2.2.x where dlopen is defined to have a "char *" as its first argument instead
of a "const char *".
Revision Changes Path
1.10 +5 -0 apache-1.3/src/os/unix/os.c
Index: os.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/os/unix/os.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- os.c 1998/04/13 18:05:19 1.9
+++ os.c 1998/04/19 12:25:22 1.10
@@ -26,7 +26,12 @@
handle = shl_load(path, BIND_IMMEDIATE|BIND_VERBOSE|BIND_NOSTART, 0L);
return (void *)handle;
#else
+#if defined(OSF1) ||\
+ (defined(__FreeBSD_version) && (__FreeBSD_version >= 220000))
+ return dlopen((char *)path, RTLD_NOW);
+#else
return dlopen(path, RTLD_NOW);
+#endif
#endif
}
Re: cvs commit: apache-1.3/src/os/unix os.c
Posted by Marc Slemko <ma...@worldgate.com>.
Is there any advantage to not just casting it for all platforms?
I think that if you think OSF1 and FreeBSD will be the only platforms that
do this, you will be quite mistaken, and having long lists of OSes in code
isn't nice when it isn't necessayr.
On 19 Apr 1998 rse@hyperreal.org wrote:
> rse 98/04/19 05:25:22
>
> Modified: src/os/unix os.c
> Log:
> Avoid warnings for discarded const under some platforms like OSF1 and FreeBSD
> 2.2.x where dlopen is defined to have a "char *" as its first argument instead
> of a "const char *".
>
> Revision Changes Path
> 1.10 +5 -0 apache-1.3/src/os/unix/os.c
>
> Index: os.c
> ===================================================================
> RCS file: /export/home/cvs/apache-1.3/src/os/unix/os.c,v
> retrieving revision 1.9
> retrieving revision 1.10
> diff -u -r1.9 -r1.10
> --- os.c 1998/04/13 18:05:19 1.9
> +++ os.c 1998/04/19 12:25:22 1.10
> @@ -26,7 +26,12 @@
> handle = shl_load(path, BIND_IMMEDIATE|BIND_VERBOSE|BIND_NOSTART, 0L);
> return (void *)handle;
> #else
> +#if defined(OSF1) ||\
> + (defined(__FreeBSD_version) && (__FreeBSD_version >= 220000))
> + return dlopen((char *)path, RTLD_NOW);
> +#else
> return dlopen(path, RTLD_NOW);
> +#endif
> #endif
> }
>
>
>
>
>