aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2016-06-14 10:08:56 +0200
committerLukas Larsson <[email protected]>2016-06-14 10:08:56 +0200
commit64515dcead288dacf4876eb0502c755f08427977 (patch)
tree266b5f2ca780c885d00efba6617e0145af0ab99e
parent2f3286f7eb10f7460e68cd268651e767e24048ef (diff)
parentfafacbdb5c3b8852e29da51933b708bbc57e8a0b (diff)
downloadotp-64515dcead288dacf4876eb0502c755f08427977.tar.gz
otp-64515dcead288dacf4876eb0502c755f08427977.tar.bz2
otp-64515dcead288dacf4876eb0502c755f08427977.zip
Merge branch 'lukas/erl_interface/fix_long_windows/OTP-13673'
* lukas/erl_interface/fix_long_windows/OTP-13673: erl_interface: Fix trace level tracing on windows erl_interface: Fix decode_ulong on windows
-rw-r--r--erts/aclocal.m46
-rw-r--r--lib/erl_interface/configure.in4
-rw-r--r--lib/erl_interface/src/misc/show_msg.c2
-rw-r--r--lib/erl_interface/test/ei_decode_SUITE_data/ei_decode_test.c10
-rw-r--r--lib/erl_interface/test/runner.erl6
5 files changed, 20 insertions, 8 deletions
diff --git a/erts/aclocal.m4 b/erts/aclocal.m4
index 86799186fd..013bfe5652 100644
--- a/erts/aclocal.m4
+++ b/erts/aclocal.m4
@@ -128,13 +128,13 @@ MIXED_MSYS=no
AC_MSG_CHECKING(for mixed cygwin or msys and native VC++ environment)
if test "X$host" = "Xwin32" -a "x$GCC" != "xyes"; then
if test -x /usr/bin/msys-?.0.dll; then
- CFLAGS="-O2"
+ CFLAGS="$CFLAGS -O2"
MIXED_MSYS=yes
AC_MSG_RESULT([MSYS and VC])
MIXED_MSYS_VC=yes
CPPFLAGS="$CPPFLAGS -DERTS_MIXED_MSYS_VC"
elif test -x /usr/bin/cygpath; then
- CFLAGS="-O2"
+ CFLAGS="$CFLAGS -O2"
MIXED_CYGWIN=yes
AC_MSG_RESULT([Cygwin and VC])
MIXED_CYGWIN_VC=yes
@@ -162,7 +162,7 @@ if test "x$MIXED_MSYS" != "xyes"; then
AC_MSG_CHECKING(for mixed cygwin and native MinGW environment)
if test "X$host" = "Xwin32" -a "x$GCC" = x"yes"; then
if test -x /usr/bin/cygpath; then
- CFLAGS="-O2"
+ CFLAGS="$CFLAGS -O2"
MIXED_CYGWIN=yes
AC_MSG_RESULT([yes])
MIXED_CYGWIN_MINGW=yes
diff --git a/lib/erl_interface/configure.in b/lib/erl_interface/configure.in
index 9e52a2adcf..0a8fbf513c 100644
--- a/lib/erl_interface/configure.in
+++ b/lib/erl_interface/configure.in
@@ -100,7 +100,9 @@ AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(long long)
-if test $ac_cv_sizeof_void_p = 8; then
+dnl We set EI_64BIT mode when long is 8 bytes, this makes things
+dnl work on windows and unix correctly
+if test $ac_cv_sizeof_long = 8; then
CFLAGS="$CFLAGS -DEI_64BIT"
fi
diff --git a/lib/erl_interface/src/misc/show_msg.c b/lib/erl_interface/src/misc/show_msg.c
index 81accab4b6..5868cccba6 100644
--- a/lib/erl_interface/src/misc/show_msg.c
+++ b/lib/erl_interface/src/misc/show_msg.c
@@ -40,6 +40,8 @@
# include <time.h>
# endif
# endif
+#else
+# include <time.h>
#endif
#include "eiext.h"
diff --git a/lib/erl_interface/test/ei_decode_SUITE_data/ei_decode_test.c b/lib/erl_interface/test/ei_decode_SUITE_data/ei_decode_test.c
index 30f5fe33a0..cfe9083065 100644
--- a/lib/erl_interface/test/ei_decode_SUITE_data/ei_decode_test.c
+++ b/lib/erl_interface/test/ei_decode_SUITE_data/ei_decode_test.c
@@ -377,8 +377,14 @@ TESTCASE(test_ei_decode_ulong)
EI_DECODE_2 (decode_ulong, 11, unsigned long, ll(0x8000000000000000));
EI_DECODE_2 (decode_ulong, 11, unsigned long, ll(0xffffffffffffffff));
} else {
- EI_DECODE_2 (decode_ulong, 7, unsigned long, 0x80000000);
- EI_DECODE_2 (decode_ulong, 7, unsigned long, 0xffffffff);
+ if (sizeof(void*) > 4) {
+ /* Windows */
+ EI_DECODE_2_FAIL(decode_ulong, 11, unsigned long, ll(0x8000000000000000));
+ EI_DECODE_2_FAIL(decode_ulong, 11, unsigned long, ll(0xffffffffffffffff));
+ } else {
+ EI_DECODE_2 (decode_ulong, 7, unsigned long, 0x80000000);
+ EI_DECODE_2 (decode_ulong, 7, unsigned long, 0xffffffff);
+ }
}
EI_DECODE_2_FAIL(decode_ulong, 9, unsigned long, ll(0x7fffffffffff));
diff --git a/lib/erl_interface/test/runner.erl b/lib/erl_interface/test/runner.erl
index 9a27eda038..1084eec2a3 100644
--- a/lib/erl_interface/test/runner.erl
+++ b/lib/erl_interface/test/runner.erl
@@ -55,7 +55,7 @@ test(Tc, Timeout) ->
%% Returns: {ok, Port}
start({Prog, Tc}) when is_list(Prog), is_integer(Tc) ->
- Port = open_port({spawn, Prog}, [{packet, 4}]),
+ Port = open_port({spawn, Prog}, [{packet, 4}, exit_status]),
Command = [Tc div 256, Tc rem 256],
Port ! {self(), {command, Command}},
Port.
@@ -125,7 +125,9 @@ get_term(Port, Timeout) ->
get_reply(Port, Timeout) when is_port(Port) ->
receive
{Port, {data, Reply}} ->
- Reply
+ Reply;
+ Fail when element(1, Fail) == Port ->
+ ct:fail("Got unexpected message from port: ~p",[Fail])
after Timeout ->
ct:fail("No response from C program")
end.