Index: src/fl_compose.cc
===================================================================
--- src/fl_compose.cc	(revision 8478)
+++ src/fl_compose.cc	(working copy)
@@ -20,7 +20,12 @@
 
 #include <octave/oct.h>
 #include <octave/parse.h>
-#include <pthread.h>    
+#ifdef HAVE_PTHREAD
+#include <pthread.h>
+#elif defined (WIN32)
+#include <windows.h>
+#include <octave/oct-locbuf.h>
+#endif
 
 #define HELP \
 "-*- texinfo -*-\n\
@@ -72,7 +77,11 @@
 float get_elem(float vec[], int row, int col,int numCols);
 void set_elem(float vec[], int row, int col, int numCols, float elem);
 int is_valid_function(octave_function *func);
+#if ! defined (HAVE_PTHREAD) && defined (WIN32)
+DWORD WINAPI thread_function(void *arg);
+#else
 void *thread_function(void *arg);
+#endif
 int get_available_cpus();
 int assign_default_func(octave_value arg, int tnorm);
 int optimal_sparse(octave_value mat_a,octave_value mat_b);
@@ -407,7 +416,11 @@
 		
 
 	// Define an array of threads
+#ifdef HAVE_PTHREAD
 	pthread_t th[num_threads];
+#elif defined (WIN32)
+	OCTAVE_LOCAL_BUFFER (HANDLE, th, num_threads);
+#endif
 
 	// If the lock_option is true, the result will be a column vector of the dimension of the diagonal 
 	// (the minimum between the rows of the matrix A and the columns of the matrix B)
@@ -432,14 +445,25 @@
 			thread_args[i].end_index = rowsA;
 			
 		// Start the thread			
+#ifdef HAVE_PTHREAD
 		pthread_create(&th[i],NULL,thread_function, (void *) &thread_args[i]);
+#elif defined (WIN32)
+		th[i] = CreateThread(NULL, 0, thread_function, (void *) &thread_args[i], 0, NULL);
+#endif
 	}
 
 	void *ans1;	
 	
 	// Wait the results from each thread
 	for(i=0; i<num_threads; i++)
+#ifdef HAVE_PTHREAD
 		pthread_join(th[i],&ans1);
+#elif defined (WIN32)
+		WaitForSingleObject(th[i], INFINITE);
+#endif
+
+	// Clean-up memory
+	delete [] thread_args;
 }
 
 
@@ -538,7 +562,11 @@
 
 
 /* Function executed by each thread */
+#if ! defined (HAVE_PTHREAD) && defined (WIN32)
+DWORD WINAPI thread_function(void *arg)
+#else
 void *thread_function(void *arg)
+#endif
 {
 	// Get the structure from the thread arguments
 	struct threadArg *thread_args;
@@ -568,7 +596,11 @@
 			set_elem(c,i,j*(1-lock_option),colsC,snorm_val);
 		}
 	}
+#if ! defined (HAVE_PTHREAD) && defined (WIN32)
+	return 0;
+#else
 	return((void *)0);
+#endif
 }
 
 
Index: src/Makefile
===================================================================
--- src/Makefile	(revision 8478)
+++ src/Makefile	(working copy)
@@ -1,9 +1,11 @@
 OCT = fl_compose.oct
 SRC := $(OCT:.oct=.cc)
 BASE := $(OCT:.oct=)
-ifdef COMSPEC 
+ifdef COMSPEC
+ifeq ($(CXX), 'g++')
 	ADDPARAM := -lpthreadVC2
 endif
+endif
 
 .phony: all
 all: $(OCT)
