Mail Archives: cygwin/2003/05/08/09:48:21
Igor,
On Wed, May 07, 2003 at 10:09:51PM -0400, Igor Pechtchanski wrote:
> I should mention, however, that this *will* *break* if Microsoft ever
> decides to release an OS with GetVersion() returning something like
> 0x0006 in the low byte (I wouldn't put it past them [OS v6, build 0]).
Oops. Good catch.
> Also, the FULL_NAMESPACE_PATH() macro doesn't examine the high-order
> bit, but that should be ok, as no Win9x variant currently returns more
> than 0x04 in the low-order byte (source: MSDN
> <http://msdn.microsoft.com/library/en-us/sysinfo/base/getversion.asp>).
Exactly my reasoning and sources too.
> It also calls GetVersion() twice every time it resolves a semaphore
> name.
I was concerned about the performance impact, but I was hoping that
calling GetVersion() wasn't too expensive.
> It might be better to use something like
>
> #define FULL_NAMESPACE_PATH(name) \
> ({WORD ver=LOWORD(GetVersion()); \
> (MAKEWORD(HIBYTE(ver),LOBYTE(ver)) >= MAKEWORD(1,5)) ? \
> NAMESPACE_PREFIX name : name})
I tried to declare a variable to save the results of GetVersion() in the
macro but I couldn't get it to work. Thanks for showing me how.
> Also, this macro uses GNU extensions,
What exactly above is a GNU extension?
> P.S. Nitpicking: the final '\' in Jason's definition of this macro is
> redundant (and will hurt if you ever choose to delete the blank line).
YA oops. YA good catch.
Thanks,
Jason
--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -