--- parser3/src/main/pa_os.C 2007/05/24 10:32:57 1.10 +++ parser3/src/main/pa_os.C 2013/07/23 13:07:49 1.13 @@ -1,18 +1,18 @@ /** @file Parser: commonly functions. - Copyright(c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_COMMON_C="$Date: 2007/05/24 10:32:57 $"; - #include "pa_config_includes.h" #include "pa_os.h" -# if defined(WIN32) -# include -# endif +volatile const char * IDENT_PA_OS_C="$Id: pa_os.C,v 1.13 2013/07/23 13:07:49 moko Exp $" IDENT_PA_OS_H; + +#ifdef _MSC_VER +#include +#endif #ifdef HAVE_FLOCK @@ -83,7 +83,10 @@ int pa_unlock(int fd) { int pa_sleep(unsigned long secs, unsigned long usecs) { - for (; usecs >= 1000000; ++secs, usecs -= 1000000); + if(usecs >= 1000000){ + secs += usecs/1000000; + usecs = usecs%1000000; + } #ifdef WIN32 Sleep(secs * 1000 + usecs / 1000);