[xiph-cvs] cvs commit: ao/src audio_out.c

Stan Seibert volsung at xiph.org
Wed Jul 25 12:55:30 PDT 2001



volsung     01/07/25 12:55:30

  Modified:    src      Tag: volsung_20010721 audio_out.c
  Log:
  OpenBSD compatability patches from Christian Weisgerber
  <naddy at mips.inka.de>.  Yes, I know #ifdef's are evil, but making C
  work on multiple UNIX's is the work of the devil to begin with.

Revision  Changes    Path
No                   revision

No                   revision

1.15.2.5  +16 -2     ao/src/audio_out.c

Index: audio_out.c
===================================================================
RCS file: /usr/local/cvsroot/ao/src/audio_out.c,v
retrieving revision 1.15.2.4
retrieving revision 1.15.2.5
diff -u -r1.15.2.4 -r1.15.2.5
--- audio_out.c	2001/07/24 17:51:11	1.15.2.4
+++ audio_out.c	2001/07/25 19:55:29	1.15.2.5
@@ -90,13 +90,27 @@
 
 
 /* Load a plugin from disk and put the function table into a driver_list
-   struct. */
+   struct.
+
+   OpenBSD systems with a.out binaries require dlsym()ed symbols to be
+   prepended with an underscore, so we need the following nasty #ifdef
+   hack. */
+#if defined(__OpenBSD__) && !defined(__ELF__)
+#define dlsym(h,s) dlsym(h, "_" s)
+#endif
 driver_list *_get_plugin(char *plugin_file)
 {
         driver_list *dt;
         void *handle;
-	
+
+	/* RTLD_NOW is the preferred symbol resolution behavior, but
+           some platforms do not support it. */
+#if defined(__OpenBSD__)	
+	handle = dlopen(plugin_file, RTLD_LAZY);
+#else
         handle = dlopen(plugin_file, RTLD_NOW);
+#endif
+
         if (handle) {
                 dt = (driver_list *)malloc(sizeof(driver_list));
                 if (!dt) return NULL;

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list