Re: #IFDEFs in a multi platform environment

From: Fred Kleinsorge (fred.nospam_at_nospam.dec.com)
Date: 09/30/04


Date: Thu, 30 Sep 2004 14:22:31 GMT


"JF Mezei" <jfmezei.spamnot@teksavvy.com> wrote in message
news:415BBFCF.A8FEB52D@teksavvy.com...
> Someone on the OSU mailing list reported that by defining __ALPHA to
compile
> the OSU software on that IA64 thing, the C compiler generated some errors.
>
> This got me to think: With VMS likely to exist on VAX, Alpha, IA64 and
AMD64,
> would it be better for applications to use __VMS32 and __VMS64 instead of
> platform specific names such as __VAX and __ALPHA?
>
> This way, they would be independant from C compiler specific definitions,
and
> one woudln't actually have to make changes to programs that run on any of
the
> 64 bit platforms VMS may be called to run on.
>
> Deep down kernel stuff can still make use of platform specific ifdefs when
> necessary, but normal user mode applications wouldn't need any
modifications
> and addition of more ifdefs for each platform.

There are specific reasons that code may need to know the precise
architecture (I do not think __AMD64 is likely to be one of them). In
general you can accomplish what you want by simply using __VAX as meaning
32-bit, and anything else as 64-bit. If you want to define specific symbols
for that meaning - that's fairly trivial.

In retrospect, most of the changes needed in porting truly are a result of
an inappropriate use of __ALPHA to mean NOT __VAX. The compiler is (I
believe) being changed so that the redefinition of __ALPHA is an
informational as opposed to a warning - for those not able or willing to
make the source code changes.



Relevant Pages

  • Re: Samba 2.2.8 for OpenVMS, new release
    ... >>Any way that it is done it is likely to require a number of object kits. ... > why would version of VMS at time of compile matter? ... Because the compiler may generate different code based on reading the ... SAMBA is GPL licensed, so the source must be provided. ...
    (comp.os.vms)
  • Re: Next project, C programming problem.
    ... Your telling me on VMS this is, ... such logicals are defined, this couldn't be the cause of the C problem. ... COBOL source files onto your VAX in a format that the VAX COBOL ... compiler can cope with. ...
    (comp.os.vms)
  • VMS83I_ICXXL-V0100 patch & HP C++ 7.1 code problem?
    ... I have a weird issue with the VMS83I_ICXXL-V0100 patch on VMS 8.3 IA64 ... I am aware of the release notes warnings for the HP C++ 7.2 compiler ...
    (comp.os.vms)
  • Re: SAMBA for VMS (The saga continues!)
    ... > callee (substitute function) code seems small to me. ... determine that the OS routine is now available. ... >>instructions and also disabling the compiler optimizer that you can rely ... they upgrade VMS and then try to install an existing package. ...
    (comp.os.vms)
  • #IFDEFs in a multi platform environment
    ... the OSU software on that IA64 thing, the C compiler generated some errors. ... With VMS likely to exist on VAX, Alpha, IA64 and AMD64, ... platform specific names such as __VAX and __ALPHA? ...
    (comp.os.vms)