cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: The #include in if2ip.c is made unconditionally ... (Daniel Stenberg)

From: Frank Chang <frank_chang91_at_hotmail.com>
Date: Sun, 16 Dec 2012 06:34:44 -0500

 
Daniel Stenberg,
>Yes, this is the change we've discussed here on this list already that Yang
>committed after your mails. Dan F objected and I'm inclined to be on Dan's
>side here and say that this change is a work-around we rather avoid.
 
>I would expect that your header order patch should be a better fix for this.

   There is one complication with the header order patch is that in ./lib/if2ip.c, the only way we can get it to compile is to put:
#include <net/if.h> before #include "setup.h" and purposely omit the conditional define , #ifdef HAVE_NET_IF_H .... #endif. Could you please suggest a way we can resolve this puzzle? Thank you for your help and I would like to help the libcurl project fix this issue.

 
 
 

> From: curl-library-request_at_cool.haxx.se
> Subject: curl-library Digest, Vol 88, Issue 33
> To: curl-library_at_cool.haxx.se
> Date: Sun, 16 Dec 2012 12:00:05 +0100
>
> Send curl-library mailing list submissions to
> curl-library_at_cool.haxx.se
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-library
> or, via email, send a message with subject or body 'help' to
> curl-library-request_at_cool.haxx.se
>
> You can reach the person managing the list at
> curl-library-owner_at_cool.haxx.se
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of curl-library digest..."
>
>
> Today's Topics:
>
> 1. Re: libcurl internal bool TRUE and FALSE definitions and
> usage(Yang Tse) (Frank Chang)
> 2. Re: The #include in if2ip.c is made unconditionally which is
> bad and needs to be fixed (Daniel Stenberg)
> 3. Re: libcurl internal bool TRUE and FALSE definitions and
> usage (Daniel Stenberg)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 16 Dec 2012 01:22:44 -0500
> From: Frank Chang <frank_chang91_at_hotmail.com>
> To: "curl-library_at_cool.haxx.se" <curl-library_at_cool.haxx.se>
> Subject: Re: libcurl internal bool TRUE and FALSE definitions and
> usage(Yang Tse)
> Message-ID: <BLU002-W21156D8535AA448E3C9A73C8B330_at_phx.gbl>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Daniel Stenberg and Yang Tse,
>
> >7. libcurl internal bool TRUE and FALSE definitions and usage
> >(Yang Tse)
>
> Yang Tse's analysis and proposed fix are excellent. Please let me know how I can help implement and/or test this proposed fic. Thank you.
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://cool.haxx.se/pipermail/curl-library/attachments/20121216/d51d4301/attachment-0001.html>
>
> ------------------------------
>
> Message: 2
> Date: Sun, 16 Dec 2012 11:00:08 +0100 (CET)
> From: Daniel Stenberg <daniel_at_haxx.se>
> To: libcurl development <curl-library_at_cool.haxx.se>
> Subject: Re: The #include in if2ip.c is made unconditionally which is
> bad and needs to be fixed
> Message-ID: <alpine.DEB.2.00.1212161057350.23355_at_tvnag.unkk.fr>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
> On Sat, 15 Dec 2012, Frank Chang wrote:
>
> > Daniel Stenberg, Please read the following email I sent to Yang Tse a few
> > hours ago. Thank you.
>
> >> * Some HP-UX system headers require TRUE defined to 1 and FALSE to 0.
> >> */
> >>
> >> #if defined(__hpux)
> >> #undef TRUE
> >> #define TRUE 1
> >> #undef FALSE
> >> #define FALSE 0
> >> #endif
> >>
> >>
> >> /*
>
> Yes, this is the change we've discussed here on this list already that Yang
> committed after your mails. Dan F objected and I'm inclined to be on Dan's
> side here and say that this change is a work-around we rather avoid.
>
> I would expect that your header order patch should be a better fix for this.
>
>
> --
>
> / daniel.haxx.se
>
>
> ------------------------------
>
> Message: 3
> Date: Sun, 16 Dec 2012 11:10:37 +0100 (CET)
> From: Daniel Stenberg <daniel_at_haxx.se>
> To: libcurl development <curl-library_at_cool.haxx.se>
> Subject: Re: libcurl internal bool TRUE and FALSE definitions and
> usage
> Message-ID: <alpine.DEB.2.00.1212161102430.23355_at_tvnag.unkk.fr>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
> On Sun, 16 Dec 2012, Yang Tse wrote:
>
> > The purpose of internally using the bool data type was to detect and avoid
> > unclever assignments to bool variables, attempting to get compiler warnings
> > or errors when such a condition existed.
>
> While a good intention, I think it is time to reevaluate if this is really
> doable nicely in the long run.
>
> > Modify libcurl to use 'private' namespace. Use 'curl_bool' instead of
> > 'bool', CURL_TRUE instead of TRUE, CURL_FALSE instead of FALSE.
> >
> > 'curl_bool' could be our own enum definition only for systems which lack
> > 'bool' or for all.
>
> I like using the traditional 'bool' name for the simple reason that it is
> familiar and what people will use and understand. Also because it prevents
> someone one from _wrongly_ introducing bool in a patch down the road when we
> miss that the contributor doesn't use curl_bool...
>
> I think we can go back to have TRUE and FALSE just be 1 and 0 for systems
> without a bool of their own.
>
> --
>
> / daniel.haxx.se
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> curl-library mailing list
> curl-library_at_cool.haxx.se
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-library
>
>
> ------------------------------
>
> End of curl-library Digest, Vol 88, Issue 33
> ********************************************
                                               

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-12-16