summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTORRI Vincent <torri@doursse.(none)>2006-11-28 20:15:27 +0100
committerTORRI Vincent <torri@doursse.(none)>2006-11-28 20:15:27 +0100
commit4c8777f87a28ff5bf45cbdddce509163dbcf8137 (patch)
tree099453faa456057a9515836045e68cc3c796891e
parente624cca7df4c2c5bc5e44af1e851e5a0d17c88bd (diff)
parentf486075fa093846c3f32b3e4b9624c039ea26ba4 (diff)
Merge branch 'master' of git+ssh://git.freedesktop.org/git/xcb/libxcb
-rw-r--r--acinclude.m47
-rw-r--r--configure.ac2
-rw-r--r--src/xcb_util.c5
-rw-r--r--tests/check_public.c35
-rw-r--r--xcb-xinerama.pc.in10
5 files changed, 46 insertions, 13 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 186873c..8b240ad 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -44,12 +44,16 @@ AC_DEFUN([AM_CHECK_DOXYGEN],
AC_HELP_STRING(
[--disable-build-docs],
[Disable the build of the documentation]),
- [if test "${disable_build_docs}" = "yes" ; then
+ [if test x"$enableval" != x"yes" ; then
enable_build_docs="no"
else
enable_build_docs="yes"
fi],
[enable_build_docs="yes"])
+
+ if test "$enable_build_docs" = "no" ; then
+ BUILD_DOCS=no
+ else
dnl
dnl Get the prefix where doxygen is installed.
dnl
@@ -93,6 +97,7 @@ AC_DEFUN([AM_CHECK_DOXYGEN],
AC_MSG_WARN(
[Warning: no doxygen detected. Documentation will not be built])
fi])
+ fi
AC_MSG_CHECKING([whether documentation is built])
AC_MSG_RESULT([${BUILD_DOCS}])
dnl
diff --git a/configure.ac b/configure.ac
index eef3fa0..d73e51f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,7 +31,7 @@ AC_SUBST(HTML_CHECK_RESULT)
# Checks for pkg-config packages
PKG_CHECK_MODULES(XCBPROTO, xcb-proto >= 1.0)
-NEEDED="xau pthread-stubs"
+NEEDED="pthread-stubs xau >= 0.99.2"
PKG_CHECK_MODULES(NEEDED, $NEEDED)
have_xdmcp="no"
diff --git a/src/xcb_util.c b/src/xcb_util.c
index bd9f2b5..eeee1dd 100644
--- a/src/xcb_util.c
+++ b/src/xcb_util.c
@@ -176,7 +176,10 @@ static int _xcb_open_decnet(const char *host, const unsigned short port)
static int _xcb_open_tcp(char *host, const unsigned short port)
{
int fd = -1;
- struct addrinfo hints = { AI_ADDRCONFIG
+ struct addrinfo hints = { 0
+#ifdef AI_ADDRCONFIG
+ | AI_ADDRCONFIG
+#endif
#ifdef AI_NUMERICSERV
| AI_NUMERICSERV
#endif
diff --git a/tests/check_public.c b/tests/check_public.c
index a28fb49..2094bfe 100644
--- a/tests/check_public.c
+++ b/tests/check_public.c
@@ -3,6 +3,7 @@
#include <stdlib.h>
#include "check_suites.h"
#include "xcb.h"
+#include "xcbext.h"
/* xcb_parse_display tests {{{ */
@@ -24,7 +25,7 @@ static void parse_display_pass(const char *name, const char *host, const int dis
if(test_type == TEST_ARGUMENT)
{
argument = name;
- putenv("DISPLAY");
+ putenv("DISPLAY=");
}
else if(test_type == TEST_ENVIRONMENT)
{
@@ -49,7 +50,7 @@ static void parse_display_pass(const char *name, const char *host, const int dis
fail_unless(strcmp(host, got_host) == 0, "screenless parse %sproduced unexpected hostname '%s' for '%s': expected '%s'", test_string[test_type], got_host, name, host);
fail_unless(display == got_display, "screenless parse %sproduced unexpected display '%d' for '%s': expected '%d'", test_string[test_type], got_display, name, display);
}
- putenv("DISPLAY");
+ putenv("DISPLAY=");
}
static void parse_display_fail(const char *name)
@@ -65,10 +66,11 @@ static void parse_display_fail(const char *name)
if(test_type == TEST_ARGUMENT)
{
argument = name;
- putenv("DISPLAY");
+ putenv("DISPLAY=");
}
else if(test_type == TEST_ENVIRONMENT)
{
+ if (!name) break;
argument = 0;
setenv("DISPLAY", name, 1);
}
@@ -90,7 +92,7 @@ static void parse_display_fail(const char *name)
fail_unless(got_host == (char *) -1, "host changed on parse failure %sfor '%s': got %p", test_string[test_type], name, got_host);
fail_unless(got_display == -42, "display changed on parse failure %sfor '%s': got %d", test_string[test_type], name, got_display);
}
- putenv("DISPLAY");
+ putenv("DISPLAY=");
}
START_TEST(parse_display_unix)
@@ -179,15 +181,38 @@ END_TEST
/* }}} */
+static void popcount_eq(uint32_t bits, int count)
+{
+ fail_unless(xcb_popcount(bits) == count, "unexpected popcount(%08x) != %d", bits, count);
+}
+
+START_TEST(popcount)
+{
+ uint32_t mask;
+ int count;
+
+ for (mask = 0xffffffff, count = 32; count >= 0; mask >>= 1, --count) {
+ popcount_eq(mask, count);
+ }
+ for (mask = 0x80000000; mask; mask >>= 1) {
+ popcount_eq(mask, 1);
+ }
+ for (mask = 0x80000000; mask > 1; mask >>= 1) {
+ popcount_eq(mask | 1, 2);
+ }
+}
+END_TEST
+
Suite *public_suite(void)
{
Suite *s = suite_create("Public API");
- putenv("DISPLAY");
+ putenv("DISPLAY=");
suite_add_test(s, parse_display_unix, "xcb_parse_display unix");
suite_add_test(s, parse_display_ip, "xcb_parse_display ip");
suite_add_test(s, parse_display_ipv4, "xcb_parse_display ipv4");
suite_add_test(s, parse_display_ipv6, "xcb_parse_display ipv6");
suite_add_test(s, parse_display_decnet, "xcb_parse_display decnet");
suite_add_test(s, parse_display_negative, "xcb_parse_display negative");
+ suite_add_test(s, popcount, "xcb_popcount");
return s;
}
diff --git a/xcb-xinerama.pc.in b/xcb-xinerama.pc.in
index 93c35a3..c4775f9 100644
--- a/xcb-xinerama.pc.in
+++ b/xcb-xinerama.pc.in
@@ -1,11 +1,11 @@
-prefix=/opt/fdo/
-exec_prefix=${prefix}
-libdir=${exec_prefix}/lib
-includedir=${prefix}/include
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
Name: XCB Xinerama
Description: XCB Xinerama Extension
-Version: 0.9.92
+Version: @PACKAGE_VERSION@
Requires: xcb
Libs: -L${libdir} -lxcb-xinerama
Cflags: -I${includedir}