Salome HOME
Porting SALOME COMPONENT module to win32 platform.
[samples/component.git] / src / SubComponent / SubComponent.cxx
index 3868afc08c6bfa6f7bb970ddcb2c06aed53a4e8f..662681db3acbd67968a8135fa9560dc0d2f10fa1 100644 (file)
@@ -26,7 +26,9 @@
 //  Module : SuperVisionTest
 //
 #include <stdio.h>
+#ifndef WIN32
 #include <unistd.h>
+#endif
 #include <fstream>
 #include <sstream>
 #include <string>
@@ -75,9 +77,13 @@ void SubComponentEngine::Sub( double x , double y , double & z ) {
   sendMessage(NOTIF_STEP, "Sub is Computing");
 //  S = 1+(int) (15.0*rand()/(RAND_MAX+1.0));
   S = 5 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   MESSAGE( "SubComponentEngine::Sub( " <<  x << " , " << y << " , " << z
        << " ) after " << S << " seconds" )
   endService( " SubComponentEngine::Sub"  );