summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2022-10-21 14:35:25 +0100
committerPhilip Withnall <pwithnall@endlessos.org>2022-10-24 10:43:43 +0100
commit8e752b27335f77b7a83ef0eaea50c6b6d607ee4a (patch)
treea334606b60bcb77afe44cd35d858aa604342939c
parent662661a8d0e1debefccb9ec5b204668bf59d140c (diff)
downloadglib-8e752b27335f77b7a83ef0eaea50c6b6d607ee4a.tar.gz
docs: Soft-deprecate G_STRUCT_OFFSET in favour of offsetof
Signed-off-by: Simon McVittie <smcv@collabora.com>
-rw-r--r--glib/docs.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/glib/docs.c b/glib/docs.c
index f93ce8048..631136d17 100644
--- a/glib/docs.c
+++ b/glib/docs.c
@@ -1829,7 +1829,12 @@
*
* Returns the offset, in bytes, of a member of a struct.
*
- * Returns: the offset of @member from the start of @struct_type
+ * Consider using standard C `offsetof()`, available since at least C89
+ * and C++98, in new code (but note that `offsetof()` returns a `size_t`
+ * rather than a `long`).
+ *
+ * Returns: the offset of @member from the start of @struct_type,
+ * as a value of type #glong.
*/
/**