GameMonkey Script

GameMonkey Script Forums
It is currently Mon Nov 20, 2017 3:37 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Apr 22, 2010 11:00 am 
Offline

Joined: Fri Feb 19, 2010 12:21 pm
Posts: 10
Now, first of all -- this may not be related to GM at all, but to my misunderstanding of VS coding practices. I'm just hoping that someone can give me a few pointers in the right direction.

See, in the DirectX wrapper library I'm using, a suggested optimization is to set the compiler to __fastcall as default. But whenever I do this, the project fails to build, with this type of errors:

Code:
Error   1   error C2664: 'gmMachine::ForEachThread' : cannot convert parameter 1 from 'bool (__fastcall *)(gmThread *,void *)' to 'gmThreadIteratorCallback'   c:\users\martin\documents\visual studio 2010\projects\nfgamemonkey\nfgamemonkey\source\include\gmmachinelib.cpp   269
Error   2   error C2664: 'gmMachine::ForEachThread' : cannot convert parameter 1 from 'bool (__fastcall *)(gmThread *,void *)' to 'gmThreadIteratorCallback'   c:\users\martin\documents\visual studio 2010\projects\nfgamemonkey\nfgamemonkey\source\include\gmmachinelib.cpp   339
Error   8   error C2664: 'gmMachine::ForEachThread' : cannot convert parameter 1 from 'bool (__fastcall *)(gmThread *,void *)' to 'gmThreadIteratorCallback'   c:\users\martin\documents\visual studio 2010\projects\nfgamemonkey\nfgamemonkey\source\include\gmdebug.cpp   334
Error   9   error C2664: 'gmMachine::ForEachThread' : cannot convert parameter 1 from 'bool (__fastcall *)(gmThread *,void *)' to 'gmThreadIteratorCallback'   c:\users\martin\documents\visual studio 2010\projects\nfgamemonkey\nfgamemonkey\source\include\gmdebug.cpp   579
Error   3   error C2440: 'initializing' : cannot convert from 'void (__fastcall *)(gmMachine *,const char *)' to 'gmPrintCallback'   c:\users\martin\documents\visual studio 2010\projects\nfgamemonkey\nfgamemonkey\source\include\gmmachine.cpp   143
Error   7   error C2440: '=' : cannot convert from 'bool (__fastcall *)(gmThread *)' to 'gmDebugRetCallback'   c:\users\martin\documents\visual studio 2010\projects\nfgamemonkey\nfgamemonkey\source\include\gmdebug.cpp   304
Error   4   error C2440: '=' : cannot convert from 'bool (__fastcall *)(gmThread *)' to 'gmDebugLineCallback'   c:\users\martin\documents\visual studio 2010\projects\nfgamemonkey\nfgamemonkey\source\include\gmdebug.cpp   301
Error   6   error C2440: '=' : cannot convert from 'bool (__fastcall *)(gmThread *)' to 'gmDebugIsBrokenCallback'   c:\users\martin\documents\visual studio 2010\projects\nfgamemonkey\nfgamemonkey\source\include\gmdebug.cpp   303
Error   5   error C2440: '=' : cannot convert from 'bool (__fastcall *)(gmThread *)' to 'gmDebugCallCallback'   c:\users\martin\documents\visual studio 2010\projects\nfgamemonkey\nfgamemonkey\source\include\gmdebug.cpp   302


It works if I turn __fastcall off, but I guess there's something I can do to get it to work overall.

Should I add GM_CDECL to some functions that don't already have it?


Top
 Profile  
Reply with quote  
PostPosted: Thu Apr 22, 2010 1:28 pm 
Offline

Joined: Fri Jan 14, 2005 2:28 am
Posts: 439
The typedefs for those callback functions use GM_CDECL, you could try removing that or changing it to fastcall too.

Code:
typedef bool (GM_CDECL *gmThreadIteratorCallback)(gmThread * a_thread, void * a_context);


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group