[beast/win32] Work around setpriority() and scandir() calls - for now.



commit 24df3dfe7e9773dd25e66984e143822d6c6773cd
Author: Stefan Westerfeld <stefan space twc de>
Date:   Fri Sep 4 18:44:05 2009 +0200

    Work around setpriority() and scandir() calls - for now.
    
    Patch based on 008_misc_fixes.diff.

 beast-gtk/bstmain.c          |    6 +++++-
 beast-gtk/gxk/gxktexttools.c |    4 ++++
 shell/bsescm.c               |    4 ++++
 3 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/beast-gtk/bstmain.c b/beast-gtk/bstmain.c
index efe03b1..362e85f 100644
--- a/beast-gtk/bstmain.c
+++ b/beast-gtk/bstmain.c
@@ -32,7 +32,9 @@
 #include <unistd.h>
 #include <string.h>
 #include <sys/time.h>
+#ifndef WIN32
 #include <sys/resource.h>
+#endif
 // #include "sfi/toyprof-mem.h"
 
 
@@ -100,7 +102,7 @@ main (int   argc,
   /* initialize random numbers */
   struct timeval tv;
   gettimeofday (&tv, NULL);
-  srand48 (tv.tv_usec + (tv.tv_sec << 16));
+  sfi_os_srand48 (tv.tv_usec + (tv.tv_sec << 16));
   srand (tv.tv_usec + (tv.tv_sec << 16));
 
   /* initialize GLib guts */
@@ -177,8 +179,10 @@ main (int   argc,
   g_source_attach (source, NULL);
   g_source_unref (source);
 
+#ifndef WIN32
   /* now that the BSE thread runs, drop scheduling priorities if we have any */
   setpriority (PRIO_PROCESS, getpid(), 0);
+#endif
 
   /* watch registration notifications on server */
   bse_proxy_connect (BSE_SERVER,
diff --git a/beast-gtk/gxk/gxktexttools.c b/beast-gtk/gxk/gxktexttools.c
index e0fec55..c20ba00 100644
--- a/beast-gtk/gxk/gxktexttools.c
+++ b/beast-gtk/gxk/gxktexttools.c
@@ -1991,7 +1991,11 @@ scroll_text_reload (GtkWidget *sctext)
           struct dirent **flist;
           gchar *tmp;
           gint n;
+#ifdef WIN32
+	  n = -1;
+#else
           n = scandir (file, &flist, NULL, alphasort);
+#endif
           if (n < 0)
             gxk_scroll_text_append_file (sctext, file); /* revert to "unknown file" */
           else
diff --git a/shell/bsescm.c b/shell/bsescm.c
index ea66808..10a3e68 100644
--- a/shell/bsescm.c
+++ b/shell/bsescm.c
@@ -23,7 +23,9 @@
 #include <sfi/sfistore.h> /* no bin-compat */
 #include <sys/time.h>
 #include <libintl.h>
+#ifndef WIN32
 #include <sys/resource.h>
+#endif
 #include "bsescminterp.h"
 #include "topconfig.h"
 
@@ -105,8 +107,10 @@ main (int   argc,
       bse_scm_context = bse_init_glue_context (PRG_NAME);
     }
 
+#ifndef WIN32
   /* now that the BSE thread runs, drop scheduling priorities if we have any */
   setpriority (PRIO_PROCESS, getpid(), 0);
+#endif
 
   gh_enter (argc, argv, gh_main);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]