delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/01/28/09:30:39

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <20000128141851.29188.qmail@web123.yahoomail.com>
Date: Fri, 28 Jan 2000 06:18:51 -0800 (PST)
From: Earnie Boyd <earnie_boyd AT yahoo DOT com>
Reply-To: earnie_boyd AT yahoo DOT com
Subject: Re: LARGE_INTEGER in w32API 0.1.5
To: kris DOT thielemans AT csc DOT mrc DOT ac DOT uk, anorland AT hem DOT passagen DOT se
Cc: Gnuwin <cygwin AT sourceware DOT cygnus DOT com>
MIME-Version: 1.0

Search for anonymous unions in the archives.

Earnie.

--- Kris Thielemans <kris DOT thielemans AT csc DOT mrc DOT ac DOT uk> wrote:
> Hi
> 
> I'm having problems with LARGE_INTEGER (defined in winnt.h). Via the cygwin
> mailing list I found out that in the distributed W32 API, LARGE_INTEGER and
> LONGLONG are flawed. Mumit advised to download your w32api 0.1.5 which I
> did. However, even
> there, the LARGE_INTEGER is not compatible with Microsoft's. The following
> code does not work:
> 
> LARGE_INTEGER a;
> DWORD b = a.LowPart;
> 
> instead, we have to use
> DWORD b = a.u.LowPart;
> 
> This fits (of course) with your definition
> 
> typedef union _LARGE_INTEGER {
> 	struct {
> 		DWORD LowPart;
> 		LONG HighPart;
> 	}_STRUCT_NAME(u);
> 	LONGLONG QuadPart;
> } LARGE_INTEGER,*PLARGE_INTEGER;
> 
> compared to Visual C++ 5.0 (an extra struct in the union):
> 
>  #if defined(MIDL_PASS)
>  typedef struct _LARGE_INTEGER {
>  #else // MIDL_PASS
>  typedef union _LARGE_INTEGER {
>      struct {
>          DWORD LowPart;
>          LONG HighPart;
>      };
>      struct {
>          DWORD LowPart;
>          LONG HighPart;
>      } u;
>  #endif //MIDL_PASS
>      LONGLONG QuadPart;
>  } LARGE_INTEGER;
> 
> 
> 
> Thanks for providng the API !
> 
> Kris
> 
> PS :
> for cygwin people. This API can be found on
> http://www.acc.umu.se/~anorland/gnu-win32/
> 
> The standard distribution defines LONGLONG as double, and
> typedef struct _LARGE_INTEGER
>  {
>    DWORD LowPart;
>   LONG  HighPart;
>  } LARGE_INTEGER, *PLARGE_INTEGER;
> 
> 
> 
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
> 
> 

=====
Earnie Boyd <mailto:earnie_boyd AT yahoo DOT com>
Cygwin Newbies, please visit
<http://www.freeyellow.com/members5/gw32/index.html>
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019