[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
BOUNCE rtl@rtlinux.org: Approval required: Non-member submissionfrom [Luiz Gustavo Bizarro Mirisola <mirisola@ic.unicamp.br> (fwd)
- To: rtl@rtlinux.org
- Subject: BOUNCE rtl@rtlinux.org: Approval required: Non-member submissionfrom [Luiz Gustavo Bizarro Mirisola <mirisola@ic.unicamp.br> (fwd)
- From: Der Herr Hofrat <der.herr@hofr.at>
- Date: Thu, 31 May 2001 17:15:58 +0200 (CEST)
>From owner-rtl Thu May 31 08:34:30 2001
Received: from grande.dcc.unicamp.br (grande.dcc.unicamp.br [143.106.7.8])
by hq.fsmlabs.com (8.11.2/8.11.2) with ESMTP id f4VEYTs08856
for <rtl@fsmlabs.com>; Thu, 31 May 2001 08:34:29 -0600
Received: from amazonas.dcc.unicamp.br (amazonas.dcc.unicamp.br [143.106.7.11])
by grande.dcc.unicamp.br (8.9.3/8.9.3) with ESMTP id KAA18113
for <rtl@fsmlabs.com>; Thu, 31 May 2001 10:50:38 -0300 (EST)
Received: from iguacu.dcc.unicamp.br (iguacu.dcc.unicamp.br [143.106.7.2])
by amazonas.dcc.unicamp.br (8.8.5/8.8.5) with ESMTP id KAA23533
for <rtl@fsmlabs.com>; Thu, 31 May 2001 10:49:20 -0300 (EST)
Received: from localhost by iguacu.dcc.unicamp.br (8.11.0/8.11.0) with ESMTP id f4VDnHr06338
for <rtl@fsmlabs.com>; Thu, 31 May 2001 10:49:17 -0300 (EST)
Date: Thu, 31 May 2001 10:49:16 -0300 (EST)
From: Luiz Gustavo Bizarro Mirisola <mirisola@ic.unicamp.br>
To: rtl@fsmlabs.com
Subject: Re: [rtl] RTLinux: C++ static members != good ?
In-Reply-To: <01053010250604.18641@cutangle.admeo.se>
Message-ID: <Pine.GSO.4.10.10105311034390.5827-100000@iguacu.dcc.unicamp.br>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Wed, 30 May 2001, David Olofson wrote:
> In your main C++ module, you need to do something like
>
> extern "C" {
> #include <linux/module.h>
>
> int init_module(void);
> void cleanup_module(void);
> __do_global_ctors_aux();
> __do_global_dtors_aux();
> };
>
> and then call __do_global_ctors_aux() from init_module(), and
> __do_global_dtors_aux() from cleanup_module(). That way, your global
> variables and object instances will be initialized and destroyed properly
> when the module is loaded and removed, respectively.
Well, I am not an gcc expert too, but I have a class with one
static atribute and some static methods and I did not need to do
anything but using the usual C++ syntax.
I have compiled it separately and linked it with the main
object file of the module.
the static attribute is an object that does not have a default
constructor... Indeed it has only a int attribute and some methods
(the methods call rt-fifo functions). is this relevant?
-----------------------------------------------------------
Luiz Gustavo Bizarro Mirisola
Mestrando em Ciencia da Computacao - IC-Unicamp/LRV-IA-CTI
MSc Student in Computer Science
mirisola@dcc.unicamp.br
-----------------------------------------------------------