From da8639784263320b7a6dac11c738ba122c54a886 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 4 Sep 2009 15:40:12 +0000 Subject: [PATCH] *** empty log message *** --- Changes | 4 +++ config.h.in | 9 +++++++ configure | 66 +++++++++++++++++++++++++++++++++++++++++++---- src/ev_cpp.h | 1 + src/keyboard.C | 4 +-- src/rxvttoolkit.C | 6 ++--- src/rxvtutil.C | 4 +-- src/rxvtutil.h | 9 ++++--- 8 files changed, 87 insertions(+), 16 deletions(-) diff --git a/Changes b/Changes index 1f6f92e1..ca6bad8b 100644 --- a/Changes +++ b/Changes @@ -54,6 +54,10 @@ TODO: perl-shell-window? the old version to macosx-pastebin-native. - document the -uc option (exg). - assertions in libev are now enabled depending on frills. + - work around arrogant bsd idiocies again: netbsd spills the default + namespace with lots of symbols "for gnu/gcc compatibility" even + though neither of them does it, and then calls the rest of the world + in need of fixing. go figure. 9.06 Sat Nov 8 17:47:18 CET 2008 - NOTICE: this release updates terminfo/termcap. diff --git a/config.h.in b/config.h.in index b855afe6..4b24a2c5 100644 --- a/config.h.in +++ b/config.h.in @@ -52,6 +52,9 @@ /* Define to 1 if you have the `clock_gettime' function. */ #undef HAVE_CLOCK_GETTIME +/* "use syscall interface for clock_gettime" */ +#undef HAVE_CLOCK_SYSCALL + /* Define to 1 if you have the header file. */ #undef HAVE_CWCHAR @@ -148,6 +151,9 @@ /* Define to 1 if you have the `setuid' function. */ #undef HAVE_SETUID +/* Define to 1 if you have the `signalfd' function. */ +#undef HAVE_SIGNALFD + /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H @@ -199,6 +205,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SIGNALFD_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKIO_H diff --git a/configure b/configure index 9bee7736..3e4dbfe2 100755 --- a/configure +++ b/configure @@ -5326,7 +5326,8 @@ done -for ac_header in sys/inotify.h sys/epoll.h sys/event.h sys/queue.h port.h poll.h sys/select.h sys/eventfd.h + +for ac_header in sys/inotify.h sys/epoll.h sys/event.h sys/queue.h port.h poll.h sys/select.h sys/eventfd.h sys/signalfd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then @@ -5473,7 +5474,8 @@ done -for ac_func in inotify_init epoll_ctl kqueue port_create poll select eventfd + +for ac_func in inotify_init epoll_ctl kqueue port_create poll select eventfd signalfd do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -5652,7 +5654,63 @@ if test $ac_cv_func_clock_gettime = yes; then : else - if test -z "$LIBEV_M4_AVOID_LIBRT"; then + if test $(uname) = Linux; then + { echo "$as_me:$LINENO: checking for clock_gettime syscall" >&5 +echo $ECHO_N "checking for clock_gettime syscall... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include +int +main () +{ +struct timespec ts; int status = syscall (SYS_clock_gettime, CLOCK_REALTIME, &ts) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_have_clock_syscall=1 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_CLOCK_SYSCALL 1 +_ACEOF + + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + fi + if test -z "$LIBEV_M4_AVOID_LIBRT" && test -z "$ac_have_clock_syscall"; then { echo "$as_me:$LINENO: checking for clock_gettime in -lrt" >&5 echo $ECHO_N "checking for clock_gettime in -lrt... $ECHO_C" >&6; } @@ -6156,8 +6214,6 @@ fi - - # Extract the first word of "tic", so it can be a program name with args. set dummy tic; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 diff --git a/src/ev_cpp.h b/src/ev_cpp.h index 1ad9172f..c0051390 100644 --- a/src/ev_cpp.h +++ b/src/ev_cpp.h @@ -2,6 +2,7 @@ #define EV_USE_POLL 0 #define EV_USE_INOTIFY 0 #define EV_USE_EVENTFD 0 +#define EV_USE_SIGNALFD 0 #define EV_MULTIPLICITY 0 #define EV_PERIODIC_ENABLE 0 #define EV_STAT_ENABLE 0 diff --git a/src/keyboard.C b/src/keyboard.C index 0008e58c..818773c5 100644 --- a/src/keyboard.C +++ b/src/keyboard.C @@ -145,8 +145,8 @@ static int compare_priority (keysym_t *a, keysym_t *b) { // (the more '1's in state; the less range): the greater priority - int ca = popcount (a->state /* & OtherModMask */); - int cb = popcount (b->state /* & OtherModMask */); + int ca = rxvt_popcount (a->state /* & OtherModMask */); + int cb = rxvt_popcount (b->state /* & OtherModMask */); if (ca != cb) return ca - cb; diff --git a/src/rxvttoolkit.C b/src/rxvttoolkit.C index 5110a818..4fb4ef9a 100644 --- a/src/rxvttoolkit.C +++ b/src/rxvttoolkit.C @@ -722,9 +722,9 @@ rxvt_color::alloc (rxvt_screen *screen, const rgba &color) if (screen->visual->c_class == TrueColor) { - c.pixel = (color.r >> (16 - popcount (screen->visual->red_mask )) << ctz (screen->visual->red_mask )) - | (color.g >> (16 - popcount (screen->visual->green_mask)) << ctz (screen->visual->green_mask)) - | (color.b >> (16 - popcount (screen->visual->blue_mask )) << ctz (screen->visual->blue_mask )); + c.pixel = (color.r >> (16 - rxvt_popcount (screen->visual->red_mask )) << rxvt_ctz (screen->visual->red_mask )) + | (color.g >> (16 - rxvt_popcount (screen->visual->green_mask)) << rxvt_ctz (screen->visual->green_mask)) + | (color.b >> (16 - rxvt_popcount (screen->visual->blue_mask )) << rxvt_ctz (screen->visual->blue_mask )); return true; } diff --git a/src/rxvtutil.C b/src/rxvtutil.C index 4aac2eb6..cfb415c2 100644 --- a/src/rxvtutil.C +++ b/src/rxvtutil.C @@ -46,7 +46,7 @@ byteorder::byteorder () } #if !HAVE_GCC_BUILTINS -int ctz (unsigned int x) CONST +int rxvt_ctz (unsigned int x) CONST { int r = 0; @@ -61,7 +61,7 @@ int ctz (unsigned int x) CONST return r; } -int popcount (unsigned int x) CONST +int rxvt_popcount (unsigned int x) CONST { x -= (x >> 1) & 0x55555555; x = ((x >> 2) & 0x33333333) + (x & 0x33333333); diff --git a/src/rxvtutil.h b/src/rxvtutil.h index 87bdcc6f..a5b9b81d 100644 --- a/src/rxvtutil.h +++ b/src/rxvtutil.h @@ -93,12 +93,13 @@ rxvt_temp_buf (int len) // some bit functions, xft fuck me plenty #if HAVE_GCC_BUILTINS -static inline int ctz (unsigned int x) { return __builtin_ctz (x); } -static inline int popcount (unsigned int x) { return __builtin_popcount (x); } +/* netbsd stupidly defines popcount itself and puts it into string.h */ +static inline int rxvt_ctz (unsigned int x) { return __builtin_ctz (x); } +static inline int rxvt_popcount (unsigned int x) { return __builtin_popcount (x); } #else // count trailing zero bits and count # of one bits -int ctz (unsigned int x) CONST; -int popcount (unsigned int x) CONST; +int rxvt_ctz (unsigned int x) CONST; +int rxvt_popcount (unsigned int x) CONST; #endif // in range including end -- 2.34.1