Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

allow alternate type to be used for ERL_NIF_TERM

  • Loading branch information...
commit 942dc6c7344f602ff752c92c968c7454bb49350c 1 parent 3087769
Daniel Goertzen authored
Showing with 9 additions and 3 deletions.
  1. +9 −3 erts/emulator/beam/erl_nif.h
12 erts/emulator/beam/erl_nif.h
View
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.