Fix compile warning and fix (sleep) primitive on Windows

db4
U-SLAVA-DFB8FF805\Slava 2008-12-13 04:49:16 -06:00
parent df2641a9ee
commit f4c3bf1dd6
2 changed files with 7 additions and 6 deletions

View File

@ -166,7 +166,7 @@ long getpagesize(void)
return g_pagesize; return g_pagesize;
} }
void sleep_micros(DWORD usec) void sleep_micros(u64 usec)
{ {
Sleep(usec); Sleep((DWORD)(usec / 1000));
} }

View File

@ -20,17 +20,18 @@ typedef wchar_t F_CHAR;
#define STRNCMP wcsncmp #define STRNCMP wcsncmp
#define STRDUP _wcsdup #define STRDUP _wcsdup
#define FIXNUM_FORMAT "%Id"
#define CELL_FORMAT "%lu" #define CELL_FORMAT "%lu"
#define CELL_HEX_FORMAT "%Ix"
#ifdef WIN64 #ifdef WIN64
#define CELL_HEX_FORMAT "%Ix"
#define CELL_HEX_PAD_FORMAT "%016Ix" #define CELL_HEX_PAD_FORMAT "%016Ix"
#define FIXNUM_FORMAT "%Id"
#else #else
#define CELL_HEX_FORMAT "%lx"
#define CELL_HEX_PAD_FORMAT "%08lx" #define CELL_HEX_PAD_FORMAT "%08lx"
#define FIXNUM_FORMAT "%ld"
#endif #endif
#define FIXNUM_FORMAT "%Id"
#define OPEN_READ(path) _wfopen(path,L"rb") #define OPEN_READ(path) _wfopen(path,L"rb")
#define OPEN_WRITE(path) _wfopen(path,L"wb") #define OPEN_WRITE(path) _wfopen(path,L"wb")
@ -49,7 +50,7 @@ void ffi_dlopen(F_DLL *dll);
void *ffi_dlsym(F_DLL *dll, F_SYMBOL *symbol); void *ffi_dlsym(F_DLL *dll, F_SYMBOL *symbol);
void ffi_dlclose(F_DLL *dll); void ffi_dlclose(F_DLL *dll);
void sleep_micros(DWORD msec); void sleep_micros(u64 msec);
INLINE void init_signals(void) {} INLINE void init_signals(void) {}
INLINE void early_init(void) {} INLINE void early_init(void) {}