Hi,
As part of our FF extension development, we are using FF SDK (which was
obtained after compiling FF 33 beta source code in MS 2010). The libs and
include are obtained from obj-i686-pc-mingw32\dist\ dir after compiled using
start-shell-msvc2010.bat (provided by MozillaBuildSetup-Latest.exe).
Till FF 32, we did not have issue in compiling the following function
const jschar* GetStringCharsZ(JSContext *cx, JSString *str) const throw()
{
if( !cx || !str)
{
return NULL;
}
return JS_GetStringCharsZ(cx, str);
}
But it appears that in FF 33 beta, the JS_GetStringCharsZ is Un-Available in
E:\me\work\builds\mozillaBuildsForPorting\firefox-33.0b1.source\mozilla-beta\js\src\jsapi.h.
When i checked the replacement code for JS_GetStringCharsZ, I found following
code available in other js src code @
http://mxr.mozilla.org/mozilla-beta/source/js/src/shell/js.cpp#1278.
JSFlatString *flat = str->ensureFlat(cx);
if (!flat)
return NULL;
AutoStableStringChars chars(cx);
if (!chars.initTwoByte(cx, flat))
return NULL;
return chars.twoByteRange().start().get();
I tried to modify my current function as below and I am getting the following
errors when i compiled in VS 2010. My include path contains these values [
$(SDK)\VS10\Firefox-SDKs\33.0.0\include;$(SDK)\VS10\Firefox-SDKs\33.0.0\include\js;$(SDK)\VS10\Firefox-SDKs\33.0.0\include\nspr
] .
Am I missing anything in include path to pick up the JSFlatString ,
AutoStableStringChars , JSString ???? All were working fine for extension built
in FF 32 .
Modified function
=================
const jschar* GetStringCharsZ(JSContext *cx, JSString *str) const throw()
{
if( !cx || !str)
{
return NULL;
}
//return JS_GetStringCharsZ(cx, str);
//RootedString
JSFlatString *flat = str->ensureFlat(cx);
if (!flat)
return NULL;
AutoStableStringChars chars(cx);
if (!chars.initTwoByte(cx, flat))
return NULL;
return chars.twoByteRange().start().get();
}
Errors
=====
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(86): error
C2027: use of undefined type 'JSString'
2>
c:\users\shanmugam_s\perforce\nco_r8.7.7_ff_32_shan_new\sdk\vs10\firefox-sdks\33.0.0\include\js/TypeDecls.h(29)
: see declaration of 'JSString'
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(86): error
C2227: left of '->ensureFlat' must point to class/struct/union/generic type
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(89): error
C2065: 'AutoStableStringChars' : undeclared identifier
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(89): error
C2146: syntax error : missing ';' before identifier 'chars'
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(89): error
C3861: 'chars': identifier not found
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(90): error
C2065: 'chars' : undeclared identifier
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(90): error
C2228: left of '.initTwoByte' must have class/struct/union
2> type is ''unknown-type''
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(92): error
C2065: 'chars' : undeclared identifier
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(92): error
C2228: left of '.twoByteRange' must have class/struct/union
2> type is ''unknown-type''
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(92): error
C2228: left of '.start' must have class/struct/union
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(92): error
C2228: left of '.get' must have class/struct/union
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(86): error
C2027: use of undefined type 'JSString'
2>
c:\users\shanmugam_s\perforce\nco_r8.7.7_ff_32_shan_new\sdk\vs10\firefox-sdks\33.0.0\include\js/TypeDecls.h(29)
: see declaration of 'JSString'
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(86): error
C2227: left of '->ensureFlat' must point to class/struct/union/generic type
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(89): error
C2065: 'AutoStableStringChars' : undeclared identifier
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(89): error
C2146: syntax error : missing ';' before identifier 'chars'
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(89): error
C3861: 'chars': identifier not found
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(90): error
C2065: 'chars' : undeclared identifier
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(90): error
C2228: left of '.initTwoByte' must have class/struct/union
2> type is ''unknown-type''
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(92): error
C2065: 'chars' : undeclared identifier
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(92): error
C2228: left of '.twoByteRange' must have class/struct/union
2> type is ''unknown-type''
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(92): error
C2228: left of '.start' must have class/struct/union
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(92): error
C2228: left of '.get' must have class/struct/union
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(86): error
C2027: use of undefined type 'JSString'
2>
c:\users\shanmugam_s\perforce\nco_r8.7.7_ff_32_shan_new\sdk\vs10\firefox-sdks\33.0.0\include\js/TypeDecls.h(29)
: see declaration of 'JSString'
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(86): error
C2227: left of '->ensureFlat' must point to class/struct/union/generic type
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(89): error
C2065: 'AutoStableStringChars' : undeclared identifier
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(89): error
C2146: syntax error : missing ';' before identifier 'chars'
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(89): error
C3861: 'chars': identifier not found
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(90): error
C2065: 'chars' : undeclared identifier
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(90): error
C2228: left of '.initTwoByte' must have class/struct/union
2> type is ''unknown-type''
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(92): error
C2065: 'chars' : undeclared identifier
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(92): error
C2228: left of '.twoByteRange' must have class/struct/union
2> type is ''unknown-type''
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(92): error
C2228: left of '.start' must have class/struct/union
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(92): error
C2228: left of '.get' must have class/struct/union
2> WebProgressImpl.cpp
2> WebProgressImplBeta.cpp
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(86): error
C2027: use of undefined type 'JSString'
2>
c:\users\shanmugam_s\perforce\nco_r8.7.7_ff_32_shan_new\sdk\vs10\firefox-sdks\33.0.0\include\js/TypeDecls.h(29)
: see declaration of 'JSString'
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(86): error
C2227: left of '->ensureFlat' must point to class/struct/union/generic type
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(89): error
C2065: 'AutoStableStringChars' : undeclared identifier
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(89): error
C2146: syntax error : missing ';' before identifier 'chars'
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(89): error
C3861: 'chars': identifier not found
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(90): error
C2065: 'chars' : undeclared identifier
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(90): error
C2228: left of '.initTwoByte' must have class/struct/union
2> type is ''unknown-type''
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(92): error
C2065: 'chars' : undeclared identifier
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(92): error
C2228: left of '.twoByteRange' must have class/struct/union
2> type is ''unknown-type''
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(92): error
C2228: left of '.start' must have class/struct/union
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(92): error
C2228: left of '.get' must have class/struct/union
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(86): error
C2027: use of undefined type 'JSString'
2>
c:\users\shanmugam_s\perforce\nco_r8.7.7_ff_32_shan_new\sdk\vs10\firefox-sdks\33.0.0\include\js/TypeDecls.h(29)
: see declaration of 'JSString'
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(86): error
C2227: left of '->ensureFlat' must point to class/struct/union/generic type
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(89): error
C2065: 'AutoStableStringChars' : undeclared identifier
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(89): error
C2146: syntax error : missing ';' before identifier 'chars'
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(89): error
C3861: 'chars': identifier not found
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(90): error
C2065: 'chars' : undeclared identifier
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(90): error
C2228: left of '.initTwoByte' must have class/struct/union
2> type is ''unknown-type''
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(92): error
C2065: 'chars' : undeclared identifier
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(92): error
C2228: left of '.twoByteRange' must have class/struct/union
2> type is ''unknown-type''
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(92): error
C2228: left of '.start' must have class/struct/union
2>c:\shan\\cofirefoxpluginbeta\cofirefoxplugin\JSFuncWrapper.h(92): error
C2228: left of '.get' must have class/struct/union
Thanks in advance,
Shan'
_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform