简体   繁体   English

Firefox OS会支持C lib吗?

[英]Will Firefox OS support C libs?

I'm developing a cross-mobile platform framework using C as base. 我正在开发一个以C为基础的跨移动平台框架。 Then i will make some wrappers for each specific platform (like ios, android, bb). 然后我将为每个特定平台(如ios,android,bb)制作一些包装器。 One of my targets platform is firefox-os. 我的目标平台之一是firefox-os。 I de like to know if will be possible to use c libs in firefox-os, but i couldn't find anything about it. 我想知道是否可以在firefox-os中使用c库,但我找不到任何关于它的东西。

If you look at the following Firefox OS architecture document it should answer your questions: https://wiki.mozilla.org/B2G/Architecture 如果您查看以下Firefox OS架构文档,它应该回答您的问题: https//wiki.mozilla.org/B2G/Architecture

For example, under Gaia it says, "Its only interface to the underlying operating system is through Open Web APIs, which are implemented by Gecko." 例如,在Gaia下,它说,“它与底层操作系统的唯一接口是通过Gecko实现的Open Web API。” That means that Javascript is the only interface you have to lower-level calls provided they are available via the Open Web APIs. 这意味着Javascript是低级别调用的唯一接口,前提是它们可通过Open Web API获得。

A workaround would be compiling your C code to JavaScript with emscripten . 解决方法是使用emscripten将您的C代码编译为JavaScript。 Firefox will implement asmjs in the near future, so the compiled code will probably be very performant (since emscripten will target asmjs as output). Firefox将在不久的将来实现asmjs ,因此编译后的代码可能非常高效(因为emscripten将asmjs作为输出)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM