delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/02/05/14:38:20

Delivered-To: listarch-cygwin AT sourceware DOT cygnus DOT com
Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <009801be5115$2623dc40$e63d2509@jonpryor.raleigh.ibm.com>
From: "Jonathan Pryor" <jonpryor AT vt DOT edu>
To: <jmm AT raleigh DOT ibm DOT com>, <cygwin AT sourceware DOT cygnus DOT com>
Subject: Re: B20.1: typedef for DWORDLONG
Date: Fri, 5 Feb 1999 09:37:26 -0500
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3

<inline>
-----Original Message-----
From: jmm AT raleigh DOT ibm DOT com <jmm AT raleigh DOT ibm DOT com>
To: cygwin AT sourceware DOT cygnus DOT com <cygwin AT sourceware DOT cygnus DOT com>
Date: Friday, February 05, 1999 9:21 AM
Subject: B20.1: typedef for DWORDLONG


>I've never done Win32-based programming before and I'm having to modify
>someone else's NT 4.0 app to do some signal handling and noticed that
>while trying to compile with B20.1, their code uses DWORDLONG as a 
>64-bit integer type (appears to be equiv to LONGLONG I think?).  Thinking
>maybe it was just their bad programming, I pulled up MS's Visual C++
>5.0 and sure enough their code examples use DWORDLONG as a 64-bit
>integer type as well.


In the Microsoft Windows headers, a DWORDLONG is typedefed to be a 
ULONGLONG, which is an unsigned __int64 (for the Microsoft compiler).
(You can find the definition in <winnt.h>, if you have a copy of the
Microsoft headers).

For Cygwin this should do what you need:

    typedef unsigned long long DWORDLONG;

>B20.1's windows32/base.h typedef's it as a double, which considering DWORD
>is an unsigned int, doesn't make sense to me.  Am I missing something
>about the type assignments (coming from Linux development, it's weird
>not to use int, long, long long, but I'm trying not to re-type everything
>in this whole app just to work with B20.1 :)
>
>Thanks,

>
>James Manning
>-- 
>Hardware Design Engineer --- IBM Netfinity Performance Development
>
>--   
>Want to unsubscribe from this list?                             
>Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

It's typedefed as a double?  Interesting... (It's been too long since I
looked at what Cygwin supported "out of the box"...)

There is a reason for this, however.  LONGLONG and its family expect
a 64-bit integer.  If the compiler doesn't support 64-bit integers, 
(or more specifically, if the compiler doesn't support the __int64 type) 
the fallback is to use a double, which is the same size (for use
in stack alignment, anyway).

I'm not sure why the GNU headers weren't updated to use a "long long" 
instead of a double, though...

 - Jon


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