- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can anyone please explain an oddity that I have come across?
In a Windows program, where I (normally) document all WinAPIs & constants from modules by USE ONLY statements, I accidentally left out the WinAPI Sleep from the kernel32 list.
It compiled without complaint, but in execution the statement:
call Sleep(500)
resulted in a sleep of 500 seconds rather than 500ms. When I put Sleep into the kernel32 USE ONLY list, it went back to the expected 500ms.
Why did it compile?
Where did it grab Sleep from when it was not in the USE ONLY list?
Puzzled as usual,
Alan
In a Windows program, where I (normally) document all WinAPIs & constants from modules by USE ONLY statements, I accidentally left out the WinAPI Sleep from the kernel32 list.
It compiled without complaint, but in execution the statement:
call Sleep(500)
resulted in a sleep of 500 seconds rather than 500ms. When I put Sleep into the kernel32 USE ONLY list, it went back to the expected 500ms.
Why did it compile?
Where did it grab Sleep from when it was not in the USE ONLY list?
Puzzled as usual,
Alan
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's SLEEP from portability library dfport.lib (portlib). Quote from docs:
To prevent DFPORT.LIB library from being passed to the linker, specify the /fpscomp:nolibs option.
Jugoslav
To prevent DFPORT.LIB library from being passed to the linker, specify the /fpscomp:nolibs option.
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jugoslav,
Thanks once more - I must examine dfport to see what other surprises it has in store.
Regards
Alan
Thanks once more - I must examine dfport to see what other surprises it has in store.
Regards
Alan

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page