Re: W32API fixes + ddk/kbdmou.h
Danny Smith <[email protected]> Wed, 12 May 2004 12:13:17 +0100
| Newsgroups | gmane.comp.gnu.mingw.patches |
|---|---|
| Message-ID | <001201c43812$21462b30$a76d65da@DANNY> |
----- Original Message -----
From: "Filip Navara"
| >
| I don't know why, but the LONGLONG member doesn't force the alignment.
| Even this simple example shows it:
| #include <windows.h>
| #include <stdio.h>
|
| int main()
| {
| printf("Alignment of LONGLONG: %x\n", __alignof(LONGLONG));
| printf("Alignment of LARGE_INTEGER: %x\n",
| __alignof(LARGE_INTEGER));
| return 0;
| }
|
| compiled with
| gcc test.c -o test.exe
|
| produces
| Alignment of LONGLONG: 8
| Alignment of LARGE_INTEGER: 4
I get this with 3.3.3 and 3.4.0:
Alignment of LONGLONG: 8
Alignment of LARGE_INTEGER: 8
| and this causes some structures to have wrong layout. For example
| VIDEO_PORT_CONFIG_INFO (ddk/video.h) doesn't have a ULONG "gap" between
| EmulatorAccessEntriesContext and VdmPhysicalVideoMemoryAddress.
|
| >Anyway should do ULARGE_INTEGER as well.
| Huh, I forgot about it. Should I resubmit the patch with ULARGE_INTEGER
| marked as DECLSPEC_ALIGN(8) too?
|
| >
| >
No need. I'll incorporate that into your patch, after I've investigated a bit more. I
don't know why I get different result than you.
Be aware that there is another bug (in BFD backend to binutills) where const data is not
aligned as per the explicit .align 16 or .align 8 asm directives generated by gcc. This
is only a problem with rdata, not data. I have a patch for that. It is probably not the
best one, but it is at least consistent with the current handling of .text and .data
section alignments.
Danny
| Thanks,
| Filip
|
|
|
| -------------------------------------------------------
| This SF.Net email is sponsored by Sleepycat Software
| Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to
| deliver higher performing products faster, at low TCO.
| http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
| _______________________________________________
| MinGW-patches mailing list
| [email protected]
| https://lists.sourceforge.net/lists/listinfo/mingw-patches
-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3