$OpenBSD: patch-filter_preview_display_c,v 1.1.1.1 2004/06/18 18:56:46 sturm Exp $
--- filter/preview/display.c.orig	2004-01-06 02:17:11.000000000 -0800
+++ filter/preview/display.c	2004-04-27 19:16:19.000000000 -0700
@@ -37,6 +37,10 @@
 #include <libdv/dv_types.h>
 #include "display.h"
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #if HAVE_LIBXV
 #include <sys/ipc.h>
 #include <sys/shm.h>
@@ -50,7 +54,7 @@
 #endif
 
 // FIXME: Use autoconf for this!!
-#if defined(__FreeBSD__) || defined(__APPLE__) /* We don't have on_exit() */
+#ifdef SYS_BSD /* We don't have on_exit() */
 dv_display_t 	*dv_dpy_on_exit_hack = NULL;
 #endif
 
@@ -211,7 +215,7 @@ dv_display_exit(dv_display_t *dv_dpy) {
 
   free(dv_dpy);
   dv_dpy = NULL;
-#if defined(__FreeBSD__) || defined(__APPLE__) /* We don't have on_exit() */
+#ifdef SYS_BSD /* We don't have on_exit() */
   dv_dpy_on_exit_hack = NULL;
 #endif
 } /* dv_display_exit */
@@ -660,6 +664,8 @@ dv_display_SDL_init(dv_display_t *dv_dpy
 
 #endif /* HAVE_SDL */
 
+#if 0 // unused
+#ifndef SYS_BSD /* We don't have on_exit() */
 static void
 dv_display_exit_handler(int code, void *arg)
 {
@@ -667,8 +673,7 @@ dv_display_exit_handler(int code, void *
     dv_display_exit(arg);
   } /* if */
 } /* dv_display_exit_handler */
-
-#if defined(__FreeBSD__) || defined(__APPLE__) /* We don't have on_exit() */
+#else
 static void
 dv_display_on_exit_hack_handler()
 {
@@ -676,7 +681,8 @@ dv_display_on_exit_hack_handler()
     dv_display_exit(dv_dpy_on_exit_hack);
   } /* if */
 } /* dv_display_exit_handler */
-#endif
+#endif  // ! SYS_BSD
+#endif  // unused
 
 int
 dv_display_init(dv_display_t *dv_dpy, int *argc, char ***argv, int width, int height, 
@@ -795,7 +801,7 @@ dv_display_init(dv_display_t *dv_dpy, in
 
  ok:
 #if 0 /* disabled because it does not seem to be needed any more */
-#if defined(__FreeBSD__) || defined(__APPLE__) /* We don't have on_exit() */
+#ifdef SYS_BSD /* We don't have on_exit() */
   dv_dpy_on_exit_hack = dv_dpy;
   atexit(dv_display_on_exit_hack_handler);
 #else
