Jump to content
  • Advertisement
Sign in to follow this  
Rain Dog

1.10.0 WIP4 compilation problems

This topic is 4993 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

If i compile w/ the asm vm i get an error such that it states that it cannot convert overloaded-function to void*. The problem function is the work_around_fmod pointer. i use .NET 2003 compiler.

Share this post


Link to post
Share on other sites
Advertisement
Thanks for letting me know. I'll try to find a better way to call the function from the assembler code.

If you could tell me how to fix it with the .NET 2003 compiler I would be grateful.

Share this post


Link to post
Share on other sites
my best estimation would be to call it w/ c++ code.

I am not at all familiar enough with assembly to suggest a more intelligent solution.

Share this post


Link to post
Share on other sites
I had this problem, all I did was to tell the compiler which version of fmod I needed. So in the as_context_86.cpp file, change the declaration to this:


static double (*double_fmod)(double, double) = fmod; //Create pointer to overloaded fmod function
static void *work_around_fmod = (void*)double_fmod;



This works with VC++ 2005 Express, so should work with the VC++ 2003?

BTW, in that file you include <math.h> and <stddef.h>. I believe the C++ standard is to include <cmath> <cstddef>. That was just in that file, there may be others.

Share this post


Link to post
Share on other sites
Thanks, that makes sense. Though it is probably easier to do it like this:

static void *work_around_fmod = (double (*)(double, double))fmod;

Yeah, I know about the header files. I haven't gotten into the habit of including the C++ headers, as the old C headers works just as well.

Share this post


Link to post
Share on other sites
yeah, this is what i added and it worked now.


static double double_fmod(double &a, double &b)
{
return fmod(a, b);
}

// Take the address of these functions, as MSVC6++ can't resolve
// them in inline assembler with full optimizations turned on
static void *work_around_memcpy = (void*)memcpy;
static void *work_around_fmod = (void*)double_fmod;

That seems to work for me.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!