This is the mail archive of the
mailing list for the Cygwin project.
Re: cygipc (and PostgreSQL) XP problem resolved!
- From: Igor Pechtchanski <pechtcha at cs dot nyu dot edu>
- To: Charles Wilson <cwilson at ece dot gatech dot edu>
- Cc: Jason Tishler <jason at tishler dot net>, <cygwin at cygwin dot com>
- Date: Wed, 7 May 2003 21:40:57 -0400 (EDT)
- Subject: Re: cygipc (and PostgreSQL) XP problem resolved!
- Reply-to: cygwin at cygwin dot com
On Wed, 7 May 2003, Charles Wilson wrote:
> Jason Tishler wrote:
> > +#define NAMESPACE_PREFIX "Global\\"
> > +#define FULL_NAMESPACE_PATH(name) \
> > + ((LOBYTE(LOWORD(GetVersion())) >= 5 && \
> > + HIBYTE(LOWORD(GetVersion())) >= 1) ? NAMESPACE_PREFIX name : name) \
> > +
> > +#define CYGWIN_IPCNT_SEMCTL FULL_NAMESPACE_PATH(CYGWIN_IPCNT_SEMCTL_BASE)
> > +#define CYGWIN_IPCNT_SEMSEM FULL_NAMESPACE_PATH(CYGWIN_IPCNT_SEMSEM_BASE)
> > +#define CYGWIN_IPCNT_SEMSHM FULL_NAMESPACE_PATH(CYGWIN_IPCNT_SEMSHM_BASE)
> > +#define CYGWIN_IPCNT_SEMMSG FULL_NAMESPACE_PATH(CYGWIN_IPCNT_SEMMSG_BASE)
> Wait, aren't #define macros resolved at compile time? This would then
> define these names as "foo" or "Global\\foo" depending on which machine
> the package was BUILT on.
> Worse, if the cygipc library itself were built on WinXP, but you build a
> client app on W98 -- then your code thinks "foo" but the daemon things
> "Global\\foo". Or vice versa.
> I think this needs to be a runtime function, not a compiletime macro.
Umm, Chuck, GetVersion() is a run-time function...
For example, the CYGWIN_IPCNT_SEMCTL macro will resolve to :
((LOBYTE(LOWORD(GetVersion())) >= 5 && HIBYTE(LOWORD(GetVersion())) >= 1) ?
"Global\\" "MultiSemCtl2_" : "MultiSemCtl2_")
which will be evaluated at run-time (the two strings between '?' and ':'
will be concatenated at compile-time, though).
|\ _,,,---,,_ email@example.com
ZZZzz /,`.-'`' -. ;-;;,_ firstname.lastname@example.org
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
Knowledge is an unending adventure at the edge of uncertainty.
-- Leto II
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html