comp.lang.ada
 help / color / mirror / Atom feed
From: Corey Minyard <minyard@acm.org>
Subject: Re: q: pkg for network/UNIX programming; system dependencies
Date: 1997/05/30
Date: 1997-05-30T00:00:00+00:00	[thread overview]
Message-ID: <m2d8q9do83.fsf@acm.org> (raw)
In-Reply-To: tx1bu5ttzs3.fsf@cygnus.com


Ken Raeburn <raeburn@cygnus.com> writes:

> I'm thinking about working on a couple small spare-time UNIX projects in
> Ada95 to help familiarize myself with the language.  Most such projects
> I'm considering right now make use of networking, both TCP and UDP.
> 
> I'm looking for a package to help me deal with UNIX system-defined types,
> socket- and network-related types and functionality, domain name service,
> etc.  I've looked at the "paradise" package, which seems to have some of
> what I want, but the latest version I could find is about 3 years old,
> only works on SunOS and HP-UX and with three specific compilers (none of
> which is GNAT), and is specifically conditionalized in various places for
> those systems and compilers.  If that's the closest thing available, I'll
> go with it; I just wanted to know if there's anything else.

I have a port of the forest-1.4 library (it compiles without error
under GNAT 3.09) with some limited Berkeley socket bindings at
http://www.concentric.net/~Minyard.  I understand that the standard
forest library is not as extensive as paradise, but I have never used
paradise.  The socket stuff I wrote is pretty limited, and I'm not an
Ada95 guru, so if anyone wants to take it and work on it, feel free.

> Oh and a general question: How do you usually deal with OS or
> configuration dependencies in Ada?  For example, some systems have the
> utmpx functions, some don't; some have wait4, some don't.  Maybe I'm
> building a package with a backwards-compatibility option enabled; maybe
> it's disabled.  In C and UNIX, I'd use #ifdef and maybe an
> autoconf-generated script to test the system characteristics and
> user-provided options, and define some macros for conditional
> compilation.
> 
> The conditionally-compiled region can be very small.  Of course, there
> are times when it's large, and when it seems worthwhile to use a separate
> source file.  But there are times when it isn't and it doesn't....

Under Ada, you generally have a file with the machine-dependent
portion of the code separated from the machine-indepenent portion.
You can link or copy the proper version to the right place to compile
it.

Ada has no conditional compilation like a #ifdef.  I and kind of
spoiled by the #ifdef, too, especially for small stuff, but having all
the machine-dependent stuff in a separate file makes porting a lot
easier because you know where all the stuff you have to fix is.

-- 
Corey Minyard               Internet:  minyard@acm.org
  Work: minyard@nortel.ca       UUCP:  minyard@wf-rch.cirr.com




  reply	other threads:[~1997-05-30  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-05-29  0:00 q: pkg for network/UNIX programming; system dependencies Ken Raeburn
1997-05-30  0:00 ` Corey Minyard [this message]
1997-05-30  0:00   ` W. Wesley Groleau (Wes)
1997-05-30  0:00 ` Jon S Anthony
     [not found]   ` <339302B7.5044@pseserv6.fw.hac.com>
1997-06-04  0:00     ` Ken Raeburn
1997-06-07  0:00     ` Robert Dewar
1997-05-31  0:00 ` Nick Roberts
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox