summaryrefslogtreecommitdiff
path: root/src/rebar_erlc_compiler.erl
diff options
context:
space:
mode:
authorSteve Vinoski <vinoski@ieee.org>2011-05-30 21:13:38 -0400
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2011-05-31 10:47:45 +0200
commit0bbb2985f069c2c1785d33da6887598673cdaaac (patch)
treef73bdd7f502f97f9588f91ac72b11bb119a2dbc2 /src/rebar_erlc_compiler.erl
parentaef6c70f598cf4cd1414bf5d4284e536f450a21a (diff)
Use external wordsize to get emulator build arch
Calling erlang:system_info(wordsize) yields the internal word size of the Erlang emulator. But due to the halfword emulator, need to pass {wordsize, external} instead to get the word size, or pointer size, as seen by external code such as NIFs. The halfword emulator has 4 byte internal words but 8 byte external words due to 64-bit compilation, which means NIFs for the halfword emulator also have to be compiled 64-bit. But just passing wordsize is equivalent to passing {wordsize, internal}, which does not indicate the pointer size for the halfword emulator. Older versions of Erlang do not support {wordsize, external}, though, so continue to pass just wordsize for those versions.
Diffstat (limited to 'src/rebar_erlc_compiler.erl')
-rw-r--r--src/rebar_erlc_compiler.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl
index 38dd198..efbdf09 100644
--- a/src/rebar_erlc_compiler.erl
+++ b/src/rebar_erlc_compiler.erl
@@ -52,7 +52,8 @@
%%
%% OtpRelease = erlang:system_info(otp_release).
%% SysArch = erlang:system_info(system_architecture).
-%% Words = integer_to_list(8 * erlang:system_info(wordsize)).
+%% Words = integer_to_list(8 *
+%% erlang:system_info({wordsize, external})).
%%
%% E.g. to define HAVE_SENDFILE only on systems with
%% sendfile(), to define BACKLOG on Linux/FreeBSD as 128,