From 1cf733f2824523b247ae97dbb70bbf876f7acffd Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Sun, 7 Dec 2014 12:55:26 +0100 Subject: [PATCH] check: Avoid requring (u)intmax_t in macros Previously embedded libcheck versions did not depend on (u)intmax_t and doing so would require projects using GStreamer's check framework to add AX_CREATE_STDINT_H to their configure.ac. A workaround is to fallback to glib types. This patch assumes that glib.h is always included before internal-check.h which is ok since everything Gstreamer would include gst/gstcheck.h instead of directly including internal-check.h. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=727826 --- libs/gst/check/libcheck/check.h.in | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libs/gst/check/libcheck/check.h.in b/libs/gst/check/libcheck/check.h.in index 306bbee..996be7b 100644 --- a/libs/gst/check/libcheck/check.h.in +++ b/libs/gst/check/libcheck/check.h.in @@ -25,8 +25,6 @@ #include #include -#include "_stdint.h" - /* Macros and functions starting with _ (underscore) are internal and may change without notice. You have been warned!. @@ -461,9 +459,10 @@ CK_DLL_EXP void CK_EXPORT _ck_assert_failed (const char *file, int line, /* Signed and unsigned integer comparison macros with improved output compared to ck_assert(). */ /* OP may be any comparison operator. */ #define _ck_assert_int(X, OP, Y) do { \ - intmax_t _ck_x = (X); \ - intmax_t _ck_y = (Y); \ - ck_assert_msg(_ck_x OP _ck_y, "Assertion '%s' failed: %s==%jd, %s==%jd", #X#OP#Y, #X, _ck_x, #Y, _ck_y); \ + gint64 _ck_x = (X); \ + gint64 _ck_y = (Y); \ + ck_assert_msg(_ck_x OP _ck_y, "Assertion '%s' failed: " \ + "%s==%" G_GINT64_FORMAT ", %s==%" G_GINT64_FORMAT, #X#OP#Y, #X, _ck_x, #Y, _ck_y); \ } while (0) /** @@ -546,9 +545,10 @@ CK_DLL_EXP void CK_EXPORT _ck_assert_failed (const char *file, int line, #define ck_assert_int_ge(X, Y) _ck_assert_int(X, >=, Y) #define _ck_assert_uint(X, OP, Y) do { \ - uintmax_t _ck_x = (X); \ - uintmax_t _ck_y = (Y); \ - ck_assert_msg(_ck_x OP _ck_y, "Assertion '%s' failed: %s==%ju, %s==%ju", #X#OP#Y, #X, _ck_x, #Y, _ck_y); \ + guint64 _ck_x = (X); \ + guint64 _ck_y = (Y); \ + ck_assert_msg(_ck_x OP _ck_y, "Assertion '%s' failed: " \ + "%s==%" G_GUINT64_FORMAT ", %s==%" G_GUINT64_FORMAT, #X#OP#Y, #X, _ck_x, #Y, _ck_y); \ } while (0) /** * Check two unsigned integers to determine if X==Y -- 2.7.4