Re: wtypes.h

"Martin Fuchs" <[email protected]> Tue, 02 Mar 2004 10:16:03 +0100
Newsgroups gmane.comp.gnu.mingw.patches
Message-ID <[email protected]>
On 02.03.2004 00:45:34 Danny Smith wrote:
> Martin, have you tested this with and without NONAMELESSUNION?

This one is better:


Changelog:
* include/wtypes.h (DEC_...): define macros for accessing DECIMAL structure
* include/wtypes.h (DECIMAL_SETZERO): use DEC_... macros in DECIMAL_SETZERO=
 macro to be compiler independed


Index: wtypes.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/src/src/winsup/w32api/include/wtypes.h,v
retrieving revision 1.13
diff -u -p -d -r1.13 wtypes.h
--- wtypes.h    1 Mar 2004 10:09:42 -0000       1.13
+++ wtypes.h    2 Mar 2004 09:13:36 -0000
@@ -11,11 +11,28 @@
 extern "C" {
 #endif

+#ifdef NONAMELESSUNION
+#define DEC_SIGN(d) ((d)->DUMMYUNIONNAME.DUMMYSTRUCTNAME.sign)
+#define DEC_SCALE(d) ((d)->DUMMYUNIONNAME.DUMMYSTRUCTNAME.scale)
+#define DEC_SIGNSCALE(d) ((d)->DUMMYUNIONNAME.signscale)
+#define DEC_MID32(d) ((d)->DUMMYUNIONNAME2.DUMMYSTRUCTNAME2.Mid32)
+#define DEC_LO32(d) ((d)->DUMMYUNIONNAME2.DUMMYSTRUCTNAME2.Lo32)
+#define DEC_LO64(d) ((d)->DUMMYUNIONNAME2.Lo64)
+#else
+#define DEC_SIGN(d) ((d)->sign)
+#define DEC_SCALE(d) ((d)->scale)
+#define DEC_SIGNSCALE(d) ((d)->signscale)
+#define DEC_MID32(d) ((d)->Mid32)
+#define DEC_LO32(d) ((d)->Lo32)
+#define DEC_LO64(d) ((d)->Lo64)
+#endif
+#define DEC_HI32(d) ((d)->Hi32)
+
 #define IID_NULL GUID_NULL
 #define CLSID_NULL GUID_NULL
 #define CBPCLIPDATA(d) ((d).cbSize-sizeof((d).ulClipFmt))
 #define DECIMAL_NEG ((BYTE)0x80)
-#define DECIMAL_SETZERO(d) {(d).Lo64=3D(d).Hi32=3D(d).signscale=3D0;}
+#define DECIMAL_SETZERO(d) {DEC_LO64(&d)=3DDEC_HI32(&d)=3DDEC_SIGNSCALE(&d=
)=3D0;}
 #define ROTFLAGS_REGISTRATIONKEEPSALIVE        0x01
 #define ROTFLAGS_ALLOWANYCLIENT                0x02



And there are also problems with V_DECIMAL in oleaut32.h.
So please don't apply this part of the other patch for now, I will fix this=


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click