<div dir="ltr"><div>Gerald is a very graceful guy.</div><div><br></div><div>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. <br></div><div><br></div><div>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.  

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