From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56756) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUOVN-0006Pq-3O for qemu-devel@nongnu.org; Mon, 01 Aug 2016 21:28:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUOVI-0005HR-4a for qemu-devel@nongnu.org; Mon, 01 Aug 2016 21:28:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51190) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUOVH-0005HL-W6 for qemu-devel@nongnu.org; Mon, 01 Aug 2016 21:28:20 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7233383F47 for ; Tue, 2 Aug 2016 01:28:19 +0000 (UTC) Date: Tue, 2 Aug 2016 09:28:17 +0800 From: Fam Zheng Message-ID: <20160802012817.GD680@ad.usersys.redhat.com> References: <1469600777-30413-1-git-send-email-famz@redhat.com> <1469600777-30413-4-git-send-email-famz@redhat.com> <5847efbb-8c5a-4e3f-6b53-daa7768abcba@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5847efbb-8c5a-4e3f-6b53-daa7768abcba@redhat.com> Subject: Re: [Qemu-devel] [PATCH for 2.8 3/3] sdl: Modularize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, Colin Lord , Gerd Hoffmann On Mon, 08/01 12:31, Paolo Bonzini wrote: > > + > > +static void sdl_init_fn(void) > > +{ > > + sdl_register_init_fun(sdl_display_init_do); > > +} > > + > > +sdl_init(sdl_init_fn); > > Can you use __attribute__((constructor)) instead of going through the > burden of defining a new type? The registration function only does a > single assignment, so it doesn't really have ordering dependencies. Yeah, it makes sense! Thanks. Fam