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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6e064806c6a78fe4 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-04-12 07:53:21 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!wn12feed!wn14feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc54.POSTED!not-for-mail From: "Jeffrey Creem" Newsgroups: comp.lang.ada References: <2a159604.0304120643.39f77838@posting.google.com> Subject: Re: Ada to C Question X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: NNTP-Posting-Host: 66.31.5.146 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc54 1050159197 66.31.5.146 (Sat, 12 Apr 2003 14:53:17 GMT) NNTP-Posting-Date: Sat, 12 Apr 2003 14:53:17 GMT Organization: AT&T Broadband Date: Sat, 12 Apr 2003 14:53:21 GMT Xref: archiver1.google.com comp.lang.ada:36103 Date: 2003-04-12T14:53:21+00:00 List-Id: I suspect you are going to have to add ugly prefixes to all of the members of the enums. (e.g typedef enum { mtYt_MyType, mtYt_YourType} myTypeYourType; ) or something similar. You will run into similar problems all over the place with overloaded procedures and even procedures of the same name in different packages since the C namespace is global and .h files are nothing like Ada specs. There are (commercial/proprietary) tools that can translate from Ada to C. While they may not do a perfect job it might be a good starting point. Even doing a hand translation, you are likely to have some issues since the code will end up being structures with an Ada bias which C programmers who work on your code in the future will not like. For instance, it is likely that you may end up with descriptive variable names and well structured code.. C programmers hate that :) (Flames to personal e-mail only..) "MPowell" wrote in message news:2a159604.0304120643.39f77838@posting.google.com... > Perhaps I'm in the wrong forum but I doing some translation from Ada > to C. > I've noticed in Ada you can do things like. > > type MYTYPE_YOURTYPE is (MyType, -- 0 > YourType); -- 1 > > type YOURTYPE_MYTYPE is (YourType, -- 0 > MyType); -- 1 > > > > > typedef enum { MyType, > YourType } MYTYPE_YOURTYPE ; > > > Obviously if I typedef on YOURTYPE_MYTYPE the compiler complains so > I'm not sure how to handle this?