Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <3EB9A54B.8060500@ece.gatech.edu>
Date: Wed, 07 May 2003 20:31:07 -0400
From: Charles Wilson <cwilson@ece.gatech.edu>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4a) Gecko/20030401
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Jason Tishler <jason@tishler.net>
CC: cygwin@cygwin.com
Subject: Re: cygipc (and PostgreSQL) XP problem resolved!
References: <20030506174725.GE1652@tishler.net> <3EB84F52.3020608@ece.gatech.edu> <20030507133326.GA1824@tishler.net>
In-Reply-To: <20030507133326.GA1824@tishler.net>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

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.

--Chuck


--
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/

