This is the mail archive of the cygwin-apps mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: a.out.h for 64-bit Cygwin?

On Mar 11 15:26, Ken Brown wrote:
> On 3/11/2013 1:43 PM, Corinna Vinschen wrote:
> >On Mar 11 12:13, Ken Brown wrote:
> >>On 3/10/2013 4:52 PM, Corinna Vinschen wrote:
> >>>No, we shouldn't include windows.h.  Some of the values are already
> >>>defined using another name in a.out.h, see I386MAGIC, DOSMAGIC, or
> >>>
> >>>I'm pretty open to add definitions for other values, as long as they
> >>>either match the already used naimg scheme, or, if they are entirely
> >>>new, are similar, but not exactly named like the original Windows
> >>>definitions.  I don't think anything speaks against adding stuff like
> >>>
> >>>   #define AMD64MAGIC 0x8664
> >>>   [...]
> >>>   #define IMG_NT_OPTIONAL_HDR32_MAGIC 0x10b
> >>>   [...]
> >>>   #define IMG_SUBSYS_NATIVE 1
> >>
> >>OK, my patch is attached.  I'm also attaching the program I used to
> >>test it, based on the emacs code I sent in my first post.  (And I'm
> >>able to build 64-bit emacs with this patch.)
> >>
> >>It turned out that the most important thing I had to do was change
> >>most occurrences of "unsigned long" to "uint32_t" to keep DWORDs
> >>from becoming 64 bits wide on AMD64.
> >>
> >>Ken
> >
> >Hi Ken.  Thanks for the patch, but I guess you misunderstood me
> >concerning the names of the defines:
> Yes, I did misunderstand.  Re-reading what you wrote, it was quite clear.
> >The rest of the patch looks good to me.  I'm just wondering what to
> >do with the mix of `unsigned {short,long}' and uint32_t.  Wouldn't
> >it be better if we replace all unsigned short with uint16_t and all
> >unsigned long with uintptr_t?
> Yes, that's much better.  I also changed a couple of occurrences of
> `short' (without `unsigned') that should have been unsigned to begin
> with.
> A revised patch is attached.

Thanks.  I applied the patch with a minor change.  I missed the fact
that a.out.h already contains definitions of values using the same name
as the definitions in the Windows header files (why did nobody tell me
I'm blind?)  Therefore there's apparently no good reason to rename
IMAGE_foo to IMG_foo, so I reverted this part of your patch.  For
completeness I also added the IMAGE_FILE_MACHINE_I386 and
IMAGE_FILE_MACHINE_AMD64 defines, for whatever that's worth.  I moved
the new definitions to the block where the other Windows definitions

Thanks again,

Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]