From 8f87745592fc829e707e0d047e1ac660fcfbb82f Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Mon, 2 May 2005 15:20:30 +0000 Subject: [PATCH] merges from 0.8 for 64 bit issues Original commit message from CVS: merges from 0.8 for 64 bit issues --- ChangeLog | 11 +++++++++ gst/gstconfig.h.in | 24 +++++++++++++++++++- tests/old/testsuite/debug/printf_extension.c | 13 ++++++++--- tests/old/testsuite/elements/property.h | 2 +- testsuite/debug/printf_extension.c | 13 ++++++++--- testsuite/elements/property.h | 2 +- 6 files changed, 56 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8849cdd550..b34dbcfd87 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2005-05-02 Thomas Vander Stichele + + * docs/gst/tmpl/gstconfig.sgml: + * gst/gstconfig.h.in: + move documentation for some symbols. Add doc for GST_PTR_FORMAT + * testsuite/debug/printf_extension.c: (main): + Do not use GST_PTR_FORMAT on pointers to types with + sizeof < sizeof(gpointer). Fixes test on 64-bit + * testsuite/elements/property.h: + use correct printf format + 2005-05-02 Wim Taymans * docs/design/draft-push-pull.txt: diff --git a/gst/gstconfig.h.in b/gst/gstconfig.h.in index b6ae066196..767cd09408 100644 --- a/gst/gstconfig.h.in +++ b/gst/gstconfig.h.in @@ -54,6 +54,12 @@ @GST_DISABLE_URI_DEFINE@ /* printf extension format */ +/** + * GST_PTR_FORMAT: + * + * printf format type used to debug GStreamer types. + * This can only be used on types whose size is >= sizeof(gpointer). + */ @GST_PRINTF_EXTENSION_FORMAT_DEFINE@ /* whether or not the CPU supports unaligned access */ @@ -67,6 +73,22 @@ # define GST_DISABLE_LOADSAVE_REGISTRY #endif +/** + * GST_EXPORT: + * + * Export the given variable from the built shared object. + * + * On Windows, this exports the variable from the DLL. + * On other platforms, this gets defined to "extern". + */ +/** + * GST_PLUGIN_EXPORT: + * + * Export the plugin's definition. + * + * On Windows, this exports the plugin definition from the DLL. + * On other platforms, this gets defined as a no-op. + */ #ifdef WIN32 #define GST_PLUGIN_EXPORT __declspec(dllexport) extern #ifdef GST_EXPORTS @@ -75,7 +97,7 @@ #define GST_EXPORT __declspec(dllimport) extern #endif #else /* not WIN32 */ -#define GST_PLUGIN_EXPORT +#define GST_PLUGIN_EXPORT #define GST_EXPORT extern #endif diff --git a/tests/old/testsuite/debug/printf_extension.c b/tests/old/testsuite/debug/printf_extension.c index cc02284244..393f68a7c7 100644 --- a/tests/old/testsuite/debug/printf_extension.c +++ b/tests/old/testsuite/debug/printf_extension.c @@ -23,7 +23,9 @@ main (gint argc, gchar * argv[]) { GstCaps *caps; GstElement *element; - G_GNUC_UNUSED int zero = 0; + G_GNUC_UNUSED gpointer null = NULL; + + /* G_GNUC_UNUSED int zero = 0; */ gst_init (&argc, &argv); @@ -34,8 +36,13 @@ main (gint argc, gchar * argv[]) GST_ERROR ("This should print caps: %" GST_PTR_FORMAT, caps); GST_ERROR ("This should print an object: %" GST_PTR_FORMAT, element); GST_ERROR ("This should print null: %" GST_PTR_FORMAT, NULL); - GST_ERROR ("This should print a pointer: %" GST_PTR_FORMAT, &zero); - //GST_ERROR ("This should print a pointer: %" GST_PTR_FORMAT, (void *)1); + GST_ERROR ("This should print a pointer: %" GST_PTR_FORMAT, &null); + /* 64 bit address to a 32 bit int will cause the GObject interpretation + * to segfault; since GST_PTR_FORMAT only works on stuff with + * sizeof(gpointer) */ + /* GST_ERROR ("This should print a pointer: %" GST_PTR_FORMAT, &zero); */ + + /* GST_ERROR ("This should print a pointer: %" GST_PTR_FORMAT, (void *)1); */ return 0; } diff --git a/tests/old/testsuite/elements/property.h b/tests/old/testsuite/elements/property.h index a1756f1ca0..199b8125b2 100644 --- a/tests/old/testsuite/elements/property.h +++ b/tests/old/testsuite/elements/property.h @@ -10,7 +10,7 @@ property_change_callback (GObject *object, GstObject *orig, GParamSpec *pspec) g_object_get_property (G_OBJECT (orig), pspec->name, &value); /* fix current bug with g_strdup_value_contents not working with gint64 */ if (G_IS_PARAM_SPEC_INT64 (pspec)) - str = g_strdup_printf ("%lld", g_value_get_int64 (&value)); + str = g_strdup_printf ("%" G_GINT64_FORMAT, g_value_get_int64 (&value)); else str = g_strdup_value_contents (&value); g_print ("%s: %s = %s\n", GST_OBJECT_NAME (orig), pspec->name, str); diff --git a/testsuite/debug/printf_extension.c b/testsuite/debug/printf_extension.c index cc02284244..393f68a7c7 100644 --- a/testsuite/debug/printf_extension.c +++ b/testsuite/debug/printf_extension.c @@ -23,7 +23,9 @@ main (gint argc, gchar * argv[]) { GstCaps *caps; GstElement *element; - G_GNUC_UNUSED int zero = 0; + G_GNUC_UNUSED gpointer null = NULL; + + /* G_GNUC_UNUSED int zero = 0; */ gst_init (&argc, &argv); @@ -34,8 +36,13 @@ main (gint argc, gchar * argv[]) GST_ERROR ("This should print caps: %" GST_PTR_FORMAT, caps); GST_ERROR ("This should print an object: %" GST_PTR_FORMAT, element); GST_ERROR ("This should print null: %" GST_PTR_FORMAT, NULL); - GST_ERROR ("This should print a pointer: %" GST_PTR_FORMAT, &zero); - //GST_ERROR ("This should print a pointer: %" GST_PTR_FORMAT, (void *)1); + GST_ERROR ("This should print a pointer: %" GST_PTR_FORMAT, &null); + /* 64 bit address to a 32 bit int will cause the GObject interpretation + * to segfault; since GST_PTR_FORMAT only works on stuff with + * sizeof(gpointer) */ + /* GST_ERROR ("This should print a pointer: %" GST_PTR_FORMAT, &zero); */ + + /* GST_ERROR ("This should print a pointer: %" GST_PTR_FORMAT, (void *)1); */ return 0; } diff --git a/testsuite/elements/property.h b/testsuite/elements/property.h index a1756f1ca0..199b8125b2 100644 --- a/testsuite/elements/property.h +++ b/testsuite/elements/property.h @@ -10,7 +10,7 @@ property_change_callback (GObject *object, GstObject *orig, GParamSpec *pspec) g_object_get_property (G_OBJECT (orig), pspec->name, &value); /* fix current bug with g_strdup_value_contents not working with gint64 */ if (G_IS_PARAM_SPEC_INT64 (pspec)) - str = g_strdup_printf ("%lld", g_value_get_int64 (&value)); + str = g_strdup_printf ("%" G_GINT64_FORMAT, g_value_get_int64 (&value)); else str = g_strdup_value_contents (&value); g_print ("%s: %s = %s\n", GST_OBJECT_NAME (orig), pspec->name, str);