Mail Archives: djgpp/2000/10/22/02:55:04
On Sun, 22 Oct 2000, Scott Brown wrote:
> A few little questions for y'all....
It is usually better to post one question per message, and make the
Subject reflect the issue. This makes the thread more easy to track.
Please consider doing that in the future.
> #1 - Is __dpmi_yield what I want to make my program stop being such a
> pig when running in a Win9x DOS box?
Yes. However, please note that there are several library functions which
call `__dpmi_yield' for you, when they are busy-waiting. Examples include
the functions `select' and `sleep'. If you call one of those functions,
you don't need to call `__dpmi_yield' explicitly.
> #2 - Is there a reliable way to detect whether long filenames are
> supported? My program relies on LFNs to function correctly, and could
> do a lot of damage if it thinks it has LFN support when it doesn't.
Are you aware that DJGPP library functions detect the LFN API
automatically and use it whenever available?
If you need to know at the application level whether LFN is available,
see the documentation of the library function `_use_lfn' in the library
reference.
> What else would be a good way to test the size of a type
> at compile time (e.g. to make sure that long is exactly 32 bits)?
You can use either LONG_MAX (from limits.h) or LONG_BITS and BITSPERBYTE
(from values.h). The former is ANSI-standard, so will work on any
platform, while the latter might be less portable to non-Posix systems.
- Raw text -