[Click] Two quick patches regarding ELEMENT_LIBS() and long long vs int64
Christian Kreibich
christian at icir.org
Thu Aug 30 22:15:39 EDT 2007
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.
--
Cheers,
Christian
More information about the click
mailing list