aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-11-16 16:42:30 +0100
committerSverker Eriksson <[email protected]>2016-11-17 16:58:50 +0100
commitdcc7f6b2901a632ff8398c1382c15eaabe562714 (patch)
tree52997a639c586c1d6f255d44ecfe060ceaa29eee
parent9a1110de820988afb4e9d195a59872b214de2d26 (diff)
downloadotp-dcc7f6b2901a632ff8398c1382c15eaabe562714.tar.gz
otp-dcc7f6b2901a632ff8398c1382c15eaabe562714.tar.bz2
otp-dcc7f6b2901a632ff8398c1382c15eaabe562714.zip
erts: Add ErtsStrToSint64
for simplify string to 64-bit integer parsing.
-rw-r--r--erts/emulator/beam/sys.h2
-rw-r--r--erts/emulator/sys/win32/erl_win_sys.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/erts/emulator/beam/sys.h b/erts/emulator/beam/sys.h
index 4557f1534d..7740dd4373 100644
--- a/erts/emulator/beam/sys.h
+++ b/erts/emulator/beam/sys.h
@@ -378,6 +378,7 @@ typedef long Sint64;
# ifdef LONG_MIN
# define ERTS_SINT64_MIN LONG_MIN
# endif
+# define ErtsStrToSint64 strtol
# elif SIZEOF_LONG_LONG == 8
# define HAVE_INT64 1
typedef unsigned long long Uint64;
@@ -391,6 +392,7 @@ typedef long long Sint64;
# ifdef LLONG_MIN
# define ERTS_SINT64_MIN LLONG_MIN
# endif
+# define ErtsStrToSint64 strtoll
# else
# error "No 64-bit integer type found"
# endif
diff --git a/erts/emulator/sys/win32/erl_win_sys.h b/erts/emulator/sys/win32/erl_win_sys.h
index 04fbf23109..78005aada9 100644
--- a/erts/emulator/sys/win32/erl_win_sys.h
+++ b/erts/emulator/sys/win32/erl_win_sys.h
@@ -182,6 +182,8 @@ typedef LONGLONG ErtsMonotonicTime;
typedef LONGLONG ErtsSysHrTime;
#endif
+#define ErtsStrToSint64 _strtoi64
+
typedef ErtsMonotonicTime ErtsSystemTime;
typedef ErtsMonotonicTime ErtsSysPerfCounter;