aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_nif.h
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2010-03-01 15:43:48 +0100
committerBjörn Gustavsson <[email protected]>2010-03-10 14:26:08 +0100
commite2f78fbb4dabb19dd908821febc64acd843ad5b4 (patch)
treebe52ec71f62725a62746cfce0ba422e9820977ba /erts/emulator/beam/erl_nif.h
parent42c8a5ab9bdcf8c139f1c5a558e64d39716a6582 (diff)
downloadotp-e2f78fbb4dabb19dd908821febc64acd843ad5b4.tar.gz
otp-e2f78fbb4dabb19dd908821febc64acd843ad5b4.tar.bz2
otp-e2f78fbb4dabb19dd908821febc64acd843ad5b4.zip
Adopt the new (R13B04) Nif functionality to the halfword codebase
Change erl_int_sizes_config to include HALFWORD_HEAP_EMULATOR, which make it possible for the NIFs to figure out the term size.
Diffstat (limited to 'erts/emulator/beam/erl_nif.h')
-rw-r--r--erts/emulator/beam/erl_nif.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_nif.h b/erts/emulator/beam/erl_nif.h
index 1ccf00293e..d0f6424724 100644
--- a/erts/emulator/beam/erl_nif.h
+++ b/erts/emulator/beam/erl_nif.h
@@ -34,7 +34,37 @@
#include <stdlib.h>
+#ifdef SIZEOF_CHAR
+# define SIZEOF_CHAR_SAVED__ SIZEOF_CHAR
+# undef SIZEOF_CHAR
+#endif
+#ifdef SIZEOF_SHORT
+# define SIZEOF_SHORT_SAVED__ SIZEOF_SHORT
+# undef SIZEOF_SHORT
+#endif
+#ifdef SIZEOF_INT
+# define SIZEOF_INT_SAVED__ SIZEOF_INT
+# undef SIZEOF_INT
+#endif
+#ifdef SIZEOF_LONG
+# define SIZEOF_LONG_SAVED__ SIZEOF_LONG
+# undef SIZEOF_LONG
+#endif
+#ifdef SIZEOF_LONG_LONG
+# define SIZEOF_LONG_LONG_SAVED__ SIZEOF_LONG_LONG
+# undef SIZEOF_LONG_LONG
+#endif
+#ifdef HALFWORD_HEAP_EMULATOR
+# define HALFWORD_HEAP_EMULATOR_SAVED__ HALFWORD_HEAP_EMULATOR
+# undef HALFWORD_HEAP_EMULATOR
+#endif
+#include "erl_int_sizes_config.h"
+
+#ifdef HALFWORD_HEAP_EMULATOR
+typedef unsigned int ERL_NIF_TERM;
+#else
typedef unsigned long ERL_NIF_TERM;
+#endif
struct enif_environment_t;
typedef struct enif_environment_t ErlNifEnv;