basho / erlang_js

A linked-in driver for Erlang to Mozilla's Spidermonkey Javascript runtime.
Apache License 2.0
238 stars 88 forks source link

Fix compilation issues with OTP 18.3 #58

Closed whitfin closed 7 years ago

whitfin commented 8 years ago

There are a few issues when compiling against OTP 18.3. I have provided this PR to demonstrate fixes for those that need them (and will add more as needed).

I'm not familiar enough with C preprocessor voodoo to figure out how to make the switch from erl_exit to erts_exit backwards compatible, so if anyone has any tips that would be great (having said that, OTP itself wasn't backwards compatible).

I actually think this project should just use it's own exit functions instead of relying on those in OTP because they're not actually meant to be public: https://github.com/erlang/otp/blob/maint/erts/emulator/drivers/common/inet_drv.c#L1576. It was changed without PR and broken in a minor version.

This will correct #51 and #53.

lemenkov commented 8 years ago

Nice.

lemenkov commented 8 years ago

The issue with erlang:now/0 was addressed already with PR #55 (which was merged). So I believe someone should rework this PR.

The remaining issue was fixed in mine PR #57 but I'm not sure if it works with older Erlang versions.

lemenkov commented 7 years ago

@zackehh could you please rebase this PR on top of develop (which now contains a fix for erlang:now/0 but still does't have fix for erl_exit) ?

whitfin commented 7 years ago

@lemenkov sure thing, I'll close this & open up a new one shortly.

whitfin commented 7 years ago

@lemenkov here you go: https://github.com/basho/erlang_js/pull/64 - I realised I could've updated this one after I'd already filed it separately, got confused with my rebase 😜