aboutsummaryrefslogtreecommitdiffstats
path: root/src/widget.c
diff options
context:
space:
mode:
authorPaul Eggert2017-06-20 08:48:14 -0700
committerPaul Eggert2017-06-20 09:01:43 -0700
commitfb45f7075afa033de27e358739cbda0107af12b2 (patch)
tree010d44c8382fd68eb13ae680d96a3cfa83aba25a /src/widget.c
parent6fcbbc393eced8350f6d4679d8070bfc48244aab (diff)
downloademacs-fb45f7075afa033de27e358739cbda0107af12b2.tar.gz
emacs-fb45f7075afa033de27e358739cbda0107af12b2.zip
Fix crash when built by GNU Gold linker on x86
Problem reported by Andrés Musetti (Bug#27248). * src/widget.c (emacsFrameClassRec): Do not initialize superclass here. (emacsFrameClass): Now a function (which initializes the superclass) instead of a variable. All uses changed.
Diffstat (limited to 'src/widget.c')
-rw-r--r--src/widget.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/widget.c b/src/widget.c
index d7ec7028517..585039d58c6 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -108,7 +108,7 @@ emacsFrameTranslations [] = "\
108 108
109static EmacsFrameClassRec emacsFrameClassRec = { 109static EmacsFrameClassRec emacsFrameClassRec = {
110 { /* core fields */ 110 { /* core fields */
111 /* superclass */ &widgetClassRec, 111 /* superclass */ 0, /* filled in by emacsFrameClass */
112 /* class_name */ (char *) "EmacsFrame", 112 /* class_name */ (char *) "EmacsFrame",
113 /* widget_size */ sizeof (EmacsFrameRec), 113 /* widget_size */ sizeof (EmacsFrameRec),
114 /* class_initialize */ 0, 114 /* class_initialize */ 0,
@@ -146,7 +146,16 @@ static EmacsFrameClassRec emacsFrameClassRec = {
146 } 146 }
147}; 147};
148 148
149WidgetClass emacsFrameClass = (WidgetClass) &emacsFrameClassRec; 149WidgetClass
150emacsFrameClass (void)
151{
152 /* Set the superclass here rather than relying on static
153 initialization, to work around an unexelf.c bug on x86 platforms
154 that use the GNU Gold linker (Bug#27248). */
155 emacsFrameClassRec.core_class.superclass = &widgetClassRec;
156
157 return (WidgetClass) &emacsFrameClassRec;
158}
150 159
151static void 160static void
152get_default_char_pixel_size (EmacsFrame ew, int *pixel_width, int *pixel_height) 161get_default_char_pixel_size (EmacsFrame ew, int *pixel_width, int *pixel_height)