From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,3869f0598191b11d X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.maxwell.syr.edu!wns13feed!worldnet.att.net!attbi_s51.POSTED!53ab2750!not-for-mail From: "Steve" Newsgroups: comp.lang.ada References: Subject: Re: Porting ADA source X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Message-ID: NNTP-Posting-Host: 24.21.42.251 X-Complaints-To: abuse@comcast.net X-Trace: attbi_s51 1090244380 24.21.42.251 (Mon, 19 Jul 2004 13:39:40 GMT) NNTP-Posting-Date: Mon, 19 Jul 2004 13:39:40 GMT Organization: Comcast Online Date: Mon, 19 Jul 2004 13:39:40 GMT Xref: g2news1.google.com comp.lang.ada:2237 Date: 2004-07-19T13:39:40+00:00 List-Id: "Giacomo Polizzi" wrote in message news:cdfu3s$k1a$1@e3k.asi.ansaldo.it... > Hello, > > I have to port an ADA program from an Unix DEC Alpha machine with a DEC ADA > compiler to a Linux pc machine with gnat (gcc) compiler. > > The task is to have, if possible, an unique source code compilable on both > platforms but there are the following problems: > > 1) some system packages that execute the same kind of operations have > different names in the two compilers > > 2) some system functions (for example mathematical function) have different > names in the two compilers Have you considered obtaining GNAT for DEC Alpha Unix? This may resolve the different names issue. > > 3) the word length is 64 bits on DEC Alpha and 32 bits on pc so it is not > always possible to use the same standard type (for example the long type is > 64 bits on Alpha and 32 bits on pc) > > 4) the standard type (long long) used by gcc on pc to solve the previous > problem is not supported by the DEC ADA compiler The basic answer here is: don't use the standard types. Define your own or use the definitions in the Interfaces package. If you have a large base or code using the predefined types, look for a tool to convert these to your own definitions. > 5) the different word length modifies some structure length used to define > interface messages with other external programs > Use representation clauses to explicitly define structure layout the same on both systems. > Is there something like #IFDEF of C language that I can use in ADA ? > I believe GNAT has a pre-processor you could use, but I have never used it. Steve (The Duck) > Is there any other kind of solution for the above problems ? > > Thanks to everybody > > Giacomo > >