Sign in to follow this  
Rain Dog

1.10.0 WIP4 compilation problems

Recommended Posts

Rain Dog    136
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
WitchLord    4678
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
desertcube    514
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
WitchLord    4678
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
Rain Dog    136
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this