Gerald is a very graceful guy.

Is there a particular reason that you want to reduce the line count?  Are
you actually trying to reduce the *size* of the application? If the
ultimate goal is due to size, you may be better off looking to see if this
section of code is similar to other files, and replace it with generics.
You may even be able to put this whole chunk into a single include file *as
written* and still save overall by always including your own headers, from
multiple files.

That said, in 2020, skimping and saving a few lines or bytes seems like an
inefficient use of your time -- the return on investment seems fairly low
for most real-world use cases.

On Thu, Jan 2, 2020 at 1:11 PM Andrew Lunn <andrew at lunn.ch> wrote:

> On Thu, Jan 02, 2020 at 11:59:42AM -0600, Brian Wood wrote:
> >    Shalom
> >
> > I have these lines:
> > #ifdef __linux__
> > #include<linux/sctp.h>
> > #else
> > #include<netinet/sctp.h>
> > #endif
> >
> > in this program:
> >
> https://github.com/Ebenezer-group/onwards/blob/master/src/cmw/tiers/cmwA.cc
>
> >
> > I'd like to see that reduced to simply one line for both
> > FreeBSD, Linux, etc.  By the grace of G-d I've managed
> > to trim that program down to 218 lines. If I could get
> > this, it would remove 4 more lines.   I'm not sure how to
> > get the ball rolling on this though?  Thanks in advance.
>
> Hi Brian
>
> I had to do a bit of research...
>
> Stream Control Transmission Protocol is defined in
> https://tools.ietf.org/html/rfc4960
>
> It describes the Stream Control Transmission Protocol (SCTP).  SCTP is
> designed to transport Public Switched Telephone Network (PSTN)
> signaling messages over IP networks, but is capable of broader
> applications.
>
> SCTP is a reliable transport protocol operating on top of a
> connectionless packet network such as IP.  It offers the following
> services to its users:
>
> https://tools.ietf.org/html/rfc6458 defines the Socket API
> extensions. But it does not state what header files should be called.
> The examples do however make use of netinet/sctp.h.
>
> After a quick search, i could not find any standard which covers the
> header file names. So it does seems to be a implementation dependent.
> But maybe there is some ISO/IEC Telecommunication Standard which
> covers this? Do you know of any?
>
> I think your best way forward is to submit a patch to glibc which
> makes netinet/sctp.h include linux/sctp.h. Argue that rfc6458 suggests
> this, and it is a backwards compatible change so won't hurt anything,
> and is compatible with other some other libc implementations.
>
>          Andrew
> _______________________________________________
> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
> tclug-list at mn-linux.org
> http://mailman.mn-linux.org/mailman/listinfo/tclug-list
>


-- 
Jeff Chapin
President, CedarLug, retired
President, UNIPC, "I'll get around to it"
President, UNI Scuba Club
Senator, NISG, retired
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mn-linux.org/pipermail/tclug-list/attachments/20200102/2be26a6a/attachment.html>