linghuye
unread,Mar 20, 2012, 2:41:46 AM3/20/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to emscripten-discuss
hi,
Recently I port my company's render engine project to javascript
with emscripten. In the project we use int64_t for id, and I use
USE_TYPED_ARRAYS=2 and I64_MODE=1 for compiling the C++ source code.
The problem is the wrongly compiled javascript code.
Source C++ is like:
A.
class CDataThreadObj{
public:
CDataThreadObj(int64_t id, DWORD uType, const char* pszIndex, DWORD
uExigence) {
// Construct stuffs
}};
B.CDataThreadObj* pAniDataObj = new CDataThreadObj(idAni,
DATA_RES_TYPE_ANI, NULL, dwExigence);
The generated javascript code is:
A. function __ZN14CDataThreadObjC1ExjPKcj($this, $id$0, $id$1, $uType,
$pszIndex, $uExigence) {}
B. var $267=__Znwj(84);
var $268=$267;
var $269=HEAP32[(($idAni)>>2)];
var $270$0=$269;
var $270$1=0;
var $271=$35;
(function() { try { __THREW__ = false; return
__ZN14CDataThreadObjC1ExjPKcj($268, $270, 4, 0, $271) } catch(e)
{} .....
The parameter $270 in __ZN14CDataThreadObjC1ExjPKcj seems wrong, I
guess it should be $270$0, $270$1, so I change it manually then it
runs corrretly.
And I do not find I64_MODE in original settings.js, I add it myself,
but the compile result is still wrong.
I dont want to manually modify these code every time, so, Is there
something wrong with my config in settings.js, or it is a bug in
current emscripten?
Thanks for your replay.
linghuye