diff options
author | Sverker Eriksson <[email protected]> | 2019-04-03 21:16:59 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2019-04-17 19:09:12 +0200 |
commit | 6465de7e3a5393a80ed0e2c63f012fd126de706f (patch) | |
tree | f85198d2afe765a8f3b7c94ed31b36830346b006 /lib/erl_interface/src/misc/ei_compat.c | |
parent | 46aa940b9d771c4806aacaf065c2f637474e9815 (diff) | |
download | otp-6465de7e3a5393a80ed0e2c63f012fd126de706f.tar.gz otp-6465de7e3a5393a80ed0e2c63f012fd126de706f.tar.bz2 otp-6465de7e3a5393a80ed0e2c63f012fd126de706f.zip |
erl_interface: Add bitstring and export fun support
Diffstat (limited to 'lib/erl_interface/src/misc/ei_compat.c')
-rw-r--r-- | lib/erl_interface/src/misc/ei_compat.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/erl_interface/src/misc/ei_compat.c b/lib/erl_interface/src/misc/ei_compat.c index ff94e144ee..787895992e 100644 --- a/lib/erl_interface/src/misc/ei_compat.c +++ b/lib/erl_interface/src/misc/ei_compat.c @@ -22,14 +22,22 @@ #include "ei.h" #include "ei_internal.h" -#define EI_COMPAT_NO_REL (~((unsigned) 0)) +#include <limits.h> -static unsigned compat_rel = EI_COMPAT_NO_REL; +#ifndef EI_COMPAT +# define EI_COMPAT UINT_MAX +#endif + +static unsigned compat_rel = EI_COMPAT; void ei_set_compat_rel(unsigned rel) { - if (compat_rel == EI_COMPAT_NO_REL) - compat_rel = rel; + compat_rel = rel; +} + +int ei_internal_use_21_bitstr_expfun(void) +{ + return compat_rel < 22; } |