This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Build Error...
#11
For what I have understand, the issue comes from a replacement of new by a macro in rpcs3\rpcs3\stdafx.h when Memory Leak from Virtual Studio is activated.

The new macro doesn't support the new placement from C++11.
But wsWidgets use the new placemend in one of its header rpcs3\wxWidgets\include\wx\any.h line 216 which is included indirectly in 3 files :
  • rpcs3\Utilities\rMsgBox.cpp
  • rpcs3\Utilities\rPlatform.cpp
  • rpcs3\rpcs3\Crypto\unpkg.cpp

I have found a thread in stackoverflow which describe a similar issue : http://stackoverflow.com/questions/11284...riding-new
However the solution it suggests may not be relevant.
Because the placement new is in a template class. Thus I don't know which "new" will be used during template instantiation in compilation, whether the "new" at the time of including the header defining the template, or the "new" at the time of template instantiation (so at the first use of template for a given type in source code).
**Can't edit my previous post before it is validated, so I post a new one. Can a moderator merge it with my previous post please ? **

EDIT1 : As said darkf in #rpcs3
Quote:<darkf> placement new isn't C++11 afaik
<darkf> it's ancient
So the new placement is not from C++11, it is quite old according to Wikipedia, but also rarely used.

EDIT2 : The class template using the placement new is instantiated in the same header. So there is no issue if at the time header is included, new operator is from standard C++.

A solution may be to save the new operator before overriding it with macro a way similar to the <crtdbg.h> file. (And that is why we are forced to override new outside crtdbg.h).

So adding a #pragma push_macro("new") before #define new DBG_NEW in stdafx.h
Then each time a problematic header is used :
  • include a macro to use the usual new with #pragma pop_macro("new"),
  • include the problematic header,
  • include a new macro to redefine back the #define new DBG_NEW.

After test, it seems to work.
I don't know the exact process to submit a fix from a local git repository to rpcs3 repository.

EDIT3: Fix submitted.
Reply


Messages In This Thread
Build Error... - by Blink123123 - 09-06-2014, 10:25 AM
RE: Build Error... - by Nekotekina - 09-06-2014, 11:22 AM
RE: Build Error... - by tambre - 09-06-2014, 11:48 AM
RE: Build Error... - by Blink123123 - 09-06-2014, 12:17 PM
RE: Build Error... - by flashmozzg - 09-06-2014, 07:13 PM
RE: Build Error... - by Blink123123 - 09-06-2014, 09:15 PM
RE: Build Error... - by Bigpet - 09-07-2014, 12:04 AM
RE: Build Error... - by Blink123123 - 09-07-2014, 12:18 AM
RE: Build Error... - by Darkriot - 09-07-2014, 01:47 AM
RE: Build Error... - by Darkriot - 09-07-2014, 03:04 AM
RE: Build Error... - by Arkaran - 09-07-2014, 04:30 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)