| ftp.delorie.com/archives/browse.cgi | search | 
| From: | Damian Yerrick <Bullcr_pd_yerrick AT hotmail DOT comRemoveBullcr_p> | 
| Newsgroups: | comp.os.msdos.djgpp | 
| Subject: | Re: Cannot use of LOCK_FUNCTION, END_OF_FUNCTION,... in classes? | 
| Organization: | Pin Eight Software http://pineight.8m.com/ | 
| Message-ID: | <tc71ts8ihcuan0s7nl6u336q6cm0kpsafr@4ax.com> | 
| References: | <8qnriq$2a5$1 AT news DOT germany DOT net> <n8jvsskmu0b5sb4qa1f2uvheu1bcirjqf7 AT 4ax DOT com> <8qp9tc$170$1 AT news DOT germany DOT net> | 
| X-Newsreader: | Forte Agent 1.7/32.534 | 
| MIME-Version: | 1.0 | 
| Lines: | 59 | 
| X-Trace: | +4vTA1QCrbWPeRsqOZHP8sap/lakFIrh3j9DNnjpbsl20f+2EY0pg4u2boUByubLe+KxxGPxA/Dd!c13LtqYanAm23nTH3gOFkx+o3H/L7Vhjs8hK/Uo19TvMxkunepk8L+Ly5Wqb6FkqU8A0sB1AUFtM!gXsa4A== | 
| X-Complaints-To: | abuse AT gte DOT net | 
| X-Abuse-Info: | Please be sure to forward a copy of ALL headers | 
| X-Abuse-Info: | Otherwise we will be unable to process your complaint properly | 
| NNTP-Posting-Date: | Tue, 26 Sep 2000 13:03:08 GMT | 
| Distribution: | world | 
| Date: | Tue, 26 Sep 2000 13:03:08 GMT | 
| To: | djgpp AT delorie DOT com | 
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp | 
| Reply-To: | djgpp AT delorie DOT com | 
On Tue, 26 Sep 2000 06:48:44 +0200, "Martin Czamai"
<M DOT Czamai AT peak-system DOT com> wrote:
>
>Damian Yerrick <Bullcr_pd_yerrick AT hotmail DOT comRemoveBullcr_p> schrieb in im
>Newsbeitrag: n8jvsskmu0b5sb4qa1f2uvheu1bcirjqf7 AT 4ax DOT com...
>> On Mon, 25 Sep 2000 17:37:59 +0200, "Martin Czamai"
>> <M DOT Czamai AT peak-system DOT com> wrote:
>>
>> >Hello,
>> >
>> >my problem is that I want to lock functions (like interrupt service
>> >routines) using the END_OF_FUNCTION and LOCK_FUNCTION macros from allegro
>in
>> >classes. This doesn't work because MYFUNCNAME_end is not a member of
>> >MYCLASS. Any idea how to fix this problem?
>> >Thanks in advance for your help
>>
>> If you're using a class method as an Allegro timer handler, make sure
>> both the method and the END_OF_FUNCTION are static.
>>
>> static void Class::my_timer(void)
>> {
>>
>> }
>> static END_OF_FUNCTION(Class::my_timer);
>
>This doesn't work - the compiler returns the error message "cannot declare
>member function Class::mytimer() to have static linkage" :-((
Been a while since I wrote C++.  Normally I stick to C or go all the
way and use Java (veering offtopic...).
>The intened purpose of the function i want to lock is the interrupt service
>routine of some piece of hardware.
>Any idea again?
I wouldn't use methods as timer handlers.  This isn't Java.
Now I remember.  The 'static' keywords go in your class declaration:
class Class
{
  ...
  static void my_timer();
  static END_OF_FUNCTION(my_timer);
  ...
}
and leave static off the implementations.
This might have _bad_ effects; I can't guarantee the performance of a
method used as a timer handler.
-- 
<O
( \   GNOME vs. KDE: the game!
 X    http://pineight.8m.com/nes.htm
This is McAfee VirusScan. Add these two lines to your signature to
prevent the spread of signature viruses.  http://www.mcafee.com/
| webmaster | delorie software privacy | 
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |