Hello,

On Sat, 25 Dec 2010 12:46:08 +0000
Pedro Alves <alves....@gmail.com> wrote:

> On Friday 24 December 2010 22:22:56, Paul Sokolovsky wrote:
> > Hello,
> > 
> > Anyone can explain me meanings and differences between _WIN32_CE &
> > UNDER_CE ? UNDER_CE is not defined by CeGCC, while used for some
> > #ifdefs. I'm going to replace these with _WIN32_CE in my clean up
> > work so far.
> 
> Would be useful to know what is it you're thinking you're cleaning up.

Hello Pedro, nice to have your attention ;-). I recently sent
several mails to the list pondering how to make what cegcc achieved
more maintainable. In short, my ideas were: extract patches from cegcc
svn repo, clean them up to contain only wince-pertinent changes and
optimize for size (change as little as possible), then use modern SCM
which allows to track upstream close and maintained changes in flexible
manner (read: git).

I currently try to to this for w32api, following procedure I outlined at
http://article.gmane.org/gmane.comp.gnu.cegcc.devel/3163 (even though I
already see drawbacks there).

> 
> UNDER_CE is a builtin define (defined by the compiler).  You can use
> it to check whether you're targetting Windows CE, even if you haven't
> included any header in your compilation unit.

Ok, I see, it is set up in your mingw32ce-gcc_20091228_r155193.diff
patch.

> 
> There is no _WIN32_CE, you mean _WIN32_WCE (I've now fixed the

Yes, sure, that's a typo.

> $subject). _WIN32_WCE is the equivalent of _WIN32_WINNT on desktop
> Windows.  You define it to the WinAPI version you want to target
> (e.g., 0x500), either on something like CFLAGS, or before including
> any w32api header.  If you don't define it to anything, the w32api
> headers define it to a default conservative Windows CE version.
> 
> Then, there's __COREDLL__ (for coredll.dll).  This is defined by the
> compiler, and it selects the C runtime.  On Desktop Windows, this
> would be either __MSVCRT__ (for msvcrt.dll), or __CRTDLL__ (legacy,
> for crtdll.dll).  Early versions of Windows CE had some other C
> runtime dll (I can't remember which now).  In mingw/ code, you always
> use __COREDLL__, _WIN32_WCE is verbotten there.

Ok, sounds good, rules for mingw are clear. But original question
popped up while looking at w32api:

$ grep -r -n UNDER_CE --exclude-dir=.svn w32api/include/
w32api/include/ws2tcpip.h:44:#ifdef UNDER_CE
w32api/include/winbase.h:813:#ifdef UNDER_CE
w32api/include/winbase.h:1189:#ifndef UNDER_CE

$ grep -r -n _WIN32_WCE --exclude-dir=.svn w32api/include/ | wc -l
174

As w32api defines _WIN32_WCE first thing and already uses it in 99%
cases, maybe it should use it exclusively?

> 
> -- 
> Pedro Alves



-- 
Best regards,
 Paul                          mailto:pmis...@gmail.com

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to