Permalink
Browse files

allow alternate type to be used for ERL_NIF_TERM

  • Loading branch information...
1 parent 3087769 commit 942dc6c7344f602ff752c92c968c7454bb49350c @goertzenator committed Mar 25, 2012
Showing with 9 additions and 3 deletions.
  1. +9 −3 erts/emulator/beam/erl_nif.h
@@ -84,16 +84,22 @@ typedef long long ErlNifSInt64;
#ifdef HALFWORD_HEAP_EMULATOR
# define ERL_NIF_VM_VARIANT "beam.halfword"
-typedef unsigned int ERL_NIF_TERM;
+typedef unsigned int ERL_NIF_TERM_INT_TYPE;
#else
# define ERL_NIF_VM_VARIANT "beam.vanilla"
# if SIZEOF_LONG == SIZEOF_VOID_P
-typedef unsigned long ERL_NIF_TERM;
+typedef unsigned long ERL_NIF_TERM_INT_TYPE;
# elif SIZEOF_LONG_LONG == SIZEOF_VOID_P
-typedef unsigned long long ERL_NIF_TERM;
+typedef unsigned long long ERL_NIF_TERM_INT_TYPE;
# endif
#endif
+#ifdef CPP11_UNIQUE_TERM_TYPE
+enum class ERL_NIF_TERM : ERL_NIF_TERM_INT_TYPE {};
+#else
+typedef ERL_NIF_TERM_INT_TYPE ERL_NIF_TERM;
+#endif
+
struct enif_environment_t;
typedef struct enif_environment_t ErlNifEnv;

0 comments on commit 942dc6c

Please sign in to comment.