public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: LARGE_INTEGER in w32API 0.1.5
@ 2000-01-29 12:21 N8TM
  0 siblings, 0 replies; 5+ messages in thread
From: N8TM @ 2000-01-29 12:21 UTC (permalink / raw)
  To: khan; +Cc: kris.thielemans, anorland, cygwin

I've been building gcc snapshots with the minimum of modifications, not 
wanting any special features, just to make the standard ones work.

I have used both an older patch of yours to handle 2 versions of 
LARGE_INTEGER (no anonymous union) and a simple hack where all the variables 
are long long int and are passed to the API functions with a cast 
(LARGE_INTEGER *)&variable, but it gets old having to patch every gcc 
snapshot.

BTW, I found that my g++ testsuite crashes on the Kayak at the office came 
from the use of an out of date binutils snapshot which actually was worse in 
that respect than standard cygwinB20.1 plus snapshot patches.  Both the 
binary from your site and newer egcs infrastructure sources work fine, and 
set up .p2align automatically, which the standard cygwin doesn't do with 
gcc-2.96, although it did with gcc-2.95.  The difference is mainly in the 
amount of useless 128-bit padding which gcc-2.96 does without .p2align.  The 
padding would be more useful if cygwin kept the stack aligned etc.

Tim

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: LARGE_INTEGER in w32API 0.1.5
  2000-01-28  5:50 N8TM
@ 2000-01-29 11:46 ` Mumit Khan
  0 siblings, 0 replies; 5+ messages in thread
From: Mumit Khan @ 2000-01-29 11:46 UTC (permalink / raw)
  To: N8TM; +Cc: kris.thielemans, anorland, cygwin

On Fri, 28 Jan 2000 N8TM@aol.com wrote:

> When this has been sorted out, the gcc distribution of 
> libf2c/libU77/[de]time_.c needs the corresponding fix.  Will there be 3 
> commonly distributed variations in LARGE_INTEGER?
> 

My local tree has the fix. The next w32api snapshot from my site will
default to _ANONYMOUS_UNION and _ANONYMOUS_STRUCT and unfortunately that
will create a few transient problems. But we need to look at the future,
and do it right before it's too late (ie., before it breaks too many 
code that uses the .u hack for lack of anon struct/union support).

Note that my recent changes to w32api (will be in the snapshot this
weekend and hopefully in Cygwin's next net release) will only turn on
this feature if the compiler supports it.

Regards,
Mumit



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: LARGE_INTEGER in w32API 0.1.5
@ 2000-01-28  6:34 Earnie Boyd
  0 siblings, 0 replies; 5+ messages in thread
From: Earnie Boyd @ 2000-01-28  6:34 UTC (permalink / raw)
  To: kris.thielemans, anorland; +Cc: Gnuwin

Search for anonymous unions in the archives.

Earnie.

--- Kris Thielemans <kris.thielemans@csc.mrc.ac.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@sourceware.cygnus.com
> 
> 

=====
Earnie Boyd < mailto:earnie_boyd@yahoo.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@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: LARGE_INTEGER in w32API 0.1.5
@ 2000-01-28  5:50 N8TM
  2000-01-29 11:46 ` Mumit Khan
  0 siblings, 1 reply; 5+ messages in thread
From: N8TM @ 2000-01-28  5:50 UTC (permalink / raw)
  To: kris.thielemans, anorland; +Cc: cygwin

When this has been sorted out, the gcc distribution of 
libf2c/libU77/[de]time_.c needs the corresponding fix.  Will there be 3 
commonly distributed variations in LARGE_INTEGER?

Tim
tprince@computer.org

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* LARGE_INTEGER in w32API 0.1.5
@ 2000-01-28  4:19 Kris Thielemans
  0 siblings, 0 replies; 5+ messages in thread
From: Kris Thielemans @ 2000-01-28  4:19 UTC (permalink / raw)
  To: anorland; +Cc: Gnuwin

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@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-01-29 12:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-29 12:21 LARGE_INTEGER in w32API 0.1.5 N8TM
  -- strict thread matches above, loose matches on Subject: below --
2000-01-28  6:34 Earnie Boyd
2000-01-28  5:50 N8TM
2000-01-29 11:46 ` Mumit Khan
2000-01-28  4:19 Kris Thielemans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).