From 96a858a442c1ed5774d11115613f50778117447b Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 14 Apr 2015 00:37:48 -0700 Subject: [PATCH] Assume C89 offsetof in widget.c * src/widget.c (XtOffset): Remove; no longer needed. (offset): Implement via offsetof instead of via pre-C89 XtOffset hack. --- src/widget.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/widget.c b/src/widget.c index acf559f313b..c45193f17f5 100644 --- a/src/widget.c +++ b/src/widget.c @@ -61,10 +61,7 @@ static void EmacsFrameResize (Widget widget); static XtGeometryResult EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *result); -#undef XtOffset -#define XtOffset(p_type,field) \ - ((Cardinal) (((char *) (&(((p_type)0)->field))) - ((char *)0))) -#define offset(field) XtOffset (EmacsFrame, emacs_frame.field) +#define offset(field) offsetof (EmacsFrameRec, emacs_frame.field) static XtResource resources[] = { {XtNgeometry, XtCGeometry, XtRString, sizeof (String), -- 2.39.2