[Click] Two quick patches regarding ELEMENT_LIBS() and long long vs int64

Eddie Kohler kohler at cs.ucla.edu
Fri Aug 31 11:29:48 EDT 2007


Hi Christian,

Thanks and thanks!!

First patch: The normal way to do this, for example in gcc's __attribute__ 
syntax, is with an extra pair of parentheses, and this is what I have checked 
in -- preferable because you won't have problems with linker arguments that 
contain quotes.

Second patch: Why isn't HAVE_LONG_LONG defined on your system?!?!?!?!??!?! 
Can you look at config.log and tell me?  In the meantime your patch is totally 
fine anyway and is checked in.

Eddie


Christian Kreibich wrote:
> Hi all,
> 
> two quick diffs while working with a fresh checkout:
> 
> (1) I have a case where I need to pass linker options inside
> ELEMENT_LIBS, of the form "-Wl,-rpath" etc, and the comma is parsed by
> the C preprocessor as meaning multiple arguments, which causes the
> (single-argument) ELEMENT_LIBS macro definition to break. By putting the
> content of ELEMENT_LIBS in quotation marks, this can be avoided
> portably, but then you don't want the quotation marks passed through to
> the command line. This tweak to click-buildtool strips out optional
> quotation marks inside the ELEMENT_LIBS definition:
> 
> Index: click-buildtool.in
> ===================================================================
> RCS file: /git/click/master/click-buildtool.in,v
> retrieving revision 1.92
> diff -u click-buildtool.in
> --- click-buildtool.in revision 1.92
> +++ click-buildtool.in working copy
> @@ -359,8 +359,8 @@
>    next
>  }
>  /:ELEMENT_LIBS/ {
> -  sub(/.*ELEMENT_LIBS[         ]*\(/, "", $2)
> -  sub(/\).*/, "", $2)
> +  sub(/.*ELEMENT_LIBS[         ]*\("?/, "", $2)
> +  sub(/"?\).*/, "", $2)
>    gsub(/[      ][      ]*/, ";", $2)
>    gsub(/-L;/, "-L", $2)
>    libs[$1] = $2
> 
> (2) I needed the below on FC7 to avoid the following long long/int64
> collision:
> 
> .../include/click/string.hh:40: error: 'String::String(int64_t)' cannot be overloaded
> .../include/click/string.hh:36: error: with 'String::String(long long int)'
> .../include/click/string.hh:41: error: 'String::String(uint64_t)' cannot be overloaded
> .../include/click/string.hh:37: error: with 'String::String(long long unsigned int)'
> 
> Index: config-userlevel.h.in
> ===================================================================
> RCS file: /git/click/master/config-userlevel.h.in,v
> retrieving revision 1.37
> diff -u config-userlevel.h.in
> --- config-userlevel.h.in revision 1.37
> +++ config-userlevel.h.in working copy
> @@ -180,7 +180,7 @@
>  #endif
> 
>  /* Define HAVE_INT64_IS_LONG_LONG based on HAVE_INT64_IS_LONG_LONG_USERLEVEL. */
> -#if HAVE_LONG_LONG && defined(HAVE_INT64_IS_LONG_LONG_USERLEVEL)
> +#ifdef HAVE_INT64_IS_LONG_LONG_USERLEVEL
>  # define HAVE_INT64_IS_LONG_LONG HAVE_INT64_IS_LONG_LONG_USERLEVEL
>  #endif
> 
> 
> Hope these help.
> 


More information about the click mailing list