- There is no alternative to sysconf(3) in win32, however the OS does
   kindly expose the number of processors as an environment variable
 - There is no random() function, use rand() instead.
---
 schroedinger/schroasync-pthread.c |    4 ++++
 schroedinger/schrofilter.c        |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/schroedinger/schroasync-pthread.c 
b/schroedinger/schroasync-pthread.c
index 0f81d30..9162648 100644
--- a/schroedinger/schroasync-pthread.c
+++ b/schroedinger/schroasync-pthread.c
@@ -79,7 +79,11 @@ schro_async_new(int n_threads,
       }
     }
     if (n_threads == 0) {
+#ifndef _WIN32
       n_threads = sysconf(_SC_NPROCESSORS_CONF);
+#else
+      n_threads = atoi(getenv("NUMBER_OF_PROCESSORS"));
+#endif
     }
     if (n_threads == 0) {
       n_threads = 1;
diff --git a/schroedinger/schrofilter.c b/schroedinger/schrofilter.c
index bc7b22c..8b300d8 100644
--- a/schroedinger/schrofilter.c
+++ b/schroedinger/schrofilter.c
@@ -16,6 +16,10 @@
 #include <string.h>
 #include <math.h>
 
+#ifdef _WIN32
+#define random() rand()
+#endif
+
 static void
 sort_u8 (uint8_t *d, int n)
 {
-- 
1.5.4.3



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Schrodinger-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/schrodinger-devel

Reply via email to