From: "Jason" Newsgroups: comp.os.msdos.djgpp References: <3cf704ff_1 AT news DOT iprimus DOT com DOT au> Subject: Re: Allegro LOCK_FUNCTION issue using C++ Lines: 37 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Original-NNTP-Posting-Host: 211.26.6.222 Message-ID: <3cf7089b_1@news.iprimus.com.au> X-Original-NNTP-Posting-Host: 127.0.0.1 Organization: iPrimus Customer - reports relating to abuse should be sent to abuse AT iprimus DOT com DOT au Date: Fri, 31 May 2002 05:21:38 GMT NNTP-Posting-Host: 203.134.67.67 X-Complaints-To: news AT primus DOT ca X-Trace: news.tor.primus.ca 1022822498 203.134.67.67 (Fri, 31 May 2002 01:21:38 EDT) NNTP-Posting-Date: Fri, 31 May 2002 01:21:38 EDT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I can explicitly cast my function with (void*), ie. LOCK_FUNCTION((void*)TimerInterrupt), but is this safe? Jase. "Jason" wrote in message news:3cf704ff_1 AT news DOT iprimus DOT com DOT au... > Hi again, > > When I compile a piece of code in C using the LOCK_FUNCTION() command, all > is well. But that *exact* piece of code with a .cpp extension gives a > compiler error. As an example, I tried compiling the 'extimer' example as > provided with Allegro. All was fine. But, look at what happens when you > change the name to extimer.cpp: > > C:\djgpp\allegro\examples>gcc -o extimer.exe extimer.cpp -lalleg > extimer.cpp: In function `int main()': > extimer.cpp:84: invalid conversion from `void (*)()' to `void*' > extimer.cpp:85: invalid conversion from `void (*)()' to `void*' > extimer.cpp:86: invalid conversion from `void (*)()' to `void*' > > Why would there be problems with this using C++? The reason I found this > was because I'm trying to compile a C++ program using the install_int > function, but keeps giving this strange (well, strange to me) error. > > Any ideas? > > Thanks, > > Jase. > > >