Horde3D

Next-Generation Graphics Engine
It is currently 29.09.2024, 10:31

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Beta3 _asm and MinGW
PostPosted: 28.03.2009, 11:46 
Offline

Joined: 08.03.2009, 14:03
Posts: 3
Location: Kraków, Poland
Hello, I trying to compile Horde beta3 with minGW and Code::Blocks but i have some error over here (beta2 works fine) :

Code:
_asm { CPUID };


D:\old\Horde3D\Source\Horde3DEngine\utTimer.h:61: error: `_asm' was not declared in this scope

What I'm doing wrong? Thanks for help me :wink:

_________________
Can you repeat that ;) ? - http://www.youtube.com/watch?v=CG0vT0s8930


Top
 Profile  
Reply with quote  
 Post subject: Re: Beta3 _asm and MinGW
PostPosted: 28.03.2009, 14:31 
Offline

Joined: 15.06.2008, 11:21
Posts: 166
Location: Germany
huh, shouldn't it be "asm volatile("cpuid");" with MinGW/GCC?

EDIT:
Of course with the appropriate ifdef around it, like
Code:
#ifdef _MSC_VER
_asm { CPUID };
#else
asm volatile("cpuid");
#endif


Top
 Profile  
Reply with quote  
 Post subject: Re: Beta3 _asm and MinGW
PostPosted: 28.03.2009, 15:37 
Offline

Joined: 08.03.2009, 14:03
Posts: 3
Location: Kraków, Poland
Thanks it works but i have next error here

Code:
      strncpy_s( _pipeSamplerBindings.back().sampler, 63, sampler.c_str(), len );


D:\old\Horde3D\Source\Horde3DEngine\egRenderer.cpp:1211: error: `strncpy_s' was not declared in this scope

_________________
Can you repeat that ;) ? - http://www.youtube.com/watch?v=CG0vT0s8930


Top
 Profile  
Reply with quote  
 Post subject: Re: Beta3 _asm and MinGW
PostPosted: 28.03.2009, 16:38 
Offline

Joined: 15.06.2008, 11:21
Posts: 166
Location: Germany
huh. That looks like some really broken usage of that function. I mean, we are already checking for wrong size in the line before, aren't we?

Anyways, look at Shared/utPlatform.h, line 53:
Code:
#   define strncpy_s( dst, dstSize, src, count ) strncpy( dst, src, count < dstSize ? count : dstSize )

We need some code to use that in case _MSC_VER is not defined as well.


Top
 Profile  
Reply with quote  
 Post subject: Re: Beta3 _asm and MinGW
PostPosted: 30.03.2009, 00:16 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
The compiler defines for the Windows platform are very MSVC centric since we don't use any other compiler. But adapting the defines for MinGW should be very easy and not require many changes.


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 12 guests


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