From d8ba750b6a6c070b8dcadd96944a096a52267fcf Mon Sep 17 00:00:00 2001 From: Paweł Zuzelski Date: Tue, 12 Jan 2010 14:16:54 +0100 Subject: better way to check WebKit version use webkit_major_version(), webkit_minor_version() and webkit_micro_version() functions to obtain webkit version instead of accessing WEBKIT_MAJOR_VERSION, WEBKIT_MINOR_VERSION and WEBKIT_MICRO_VERSION directly. WEBKIT_M*_VERSION are defined in header files included by uzbl code, so they contain WebKit version that uzbl was compiled against. webkit_m*_version() functions return WebKit version that is realy used at the moment. --- src/uzbl-core.c | 6 +++--- tests/test-expand.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/uzbl-core.c b/src/uzbl-core.c index c9b3825..3e164c6 100644 --- a/src/uzbl-core.c +++ b/src/uzbl-core.c @@ -2518,9 +2518,9 @@ initialize(int argc, char *argv[]) { } event_buffer_timeout(10); - uzbl.info.webkit_major = WEBKIT_MAJOR_VERSION; - uzbl.info.webkit_minor = WEBKIT_MINOR_VERSION; - uzbl.info.webkit_micro = WEBKIT_MICRO_VERSION; + uzbl.info.webkit_major = webkit_major_version(); + uzbl.info.webkit_minor = webkit_minor_version(); + uzbl.info.webkit_micro = webkit_micro_version(); uzbl.info.arch = ARCH; uzbl.info.commit = COMMIT; diff --git a/tests/test-expand.c b/tests/test-expand.c index ef07c80..01af401 100644 --- a/tests/test-expand.c +++ b/tests/test-expand.c @@ -72,11 +72,11 @@ test_useragent (void) { void test_WEBKIT_VERSION (void) { GString* expected = g_string_new(""); - g_string_append(expected, itos(WEBKIT_MAJOR_VERSION)); + g_string_append(expected, itos(webkit_major_version())); g_string_append(expected, " "); - g_string_append(expected, itos(WEBKIT_MINOR_VERSION)); + g_string_append(expected, itos(webkit_minor_version())); g_string_append(expected, " "); - g_string_append(expected, itos(WEBKIT_MICRO_VERSION)); + g_string_append(expected, itos(webkit_micro_version())); g_assert_cmpstr(expand("@WEBKIT_MAJOR @WEBKIT_MINOR @WEBKIT_MICRO", 0), ==, g_string_free(expected, FALSE)); } -- cgit v1.2.3