diff options
author | Micael Karlberg <[email protected]> | 2019-01-31 11:34:03 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2019-02-01 17:35:53 +0100 |
commit | 875825874d4a8d52ec5cc593f5024afc696c29df (patch) | |
tree | 630ae902108597454cb9bb1670f4c14351932c5f /erts/preloaded | |
parent | 060338c0a6904cc4aaf5226dc7fb321ad3d23862 (diff) | |
download | otp-875825874d4a8d52ec5cc593f5024afc696c29df.tar.gz otp-875825874d4a8d52ec5cc593f5024afc696c29df.tar.bz2 otp-875825874d4a8d52ec5cc593f5024afc696c29df.zip |
[socket-nif] nosup expection of win32 and type(s) replacements
The nif callback functions (nif_open) now instead cause an
'nosup' exception if called (instead of badarg).
The basic type uint16_t, uint32_t and int32_t (C99) replaced
"own" (that is, defined by "us") types Uint16, Uint32 and
Sint32.
The point of this is that our Windows build system seems to
be a bit lacking when it comes to types...
Removed "some stuff" that was if-defed. Different solution
when win32 support for sockets has been improved.
Make sure the socket_*.c util modules are not included
in the building for windows.
OTP-15526
Diffstat (limited to 'erts/preloaded')
-rw-r--r-- | erts/preloaded/ebin/socket.beam | bin | 69888 -> 71096 bytes | |||
-rw-r--r-- | erts/preloaded/src/socket.erl | 28 |
2 files changed, 28 insertions, 0 deletions
diff --git a/erts/preloaded/ebin/socket.beam b/erts/preloaded/ebin/socket.beam Binary files differindex 0066ca2433..507556791e 100644 --- a/erts/preloaded/ebin/socket.beam +++ b/erts/preloaded/ebin/socket.beam diff --git a/erts/preloaded/src/socket.erl b/erts/preloaded/src/socket.erl index 80ccd7ea10..287ef1d791 100644 --- a/erts/preloaded/src/socket.erl +++ b/erts/preloaded/src/socket.erl @@ -1055,6 +1055,10 @@ open(Domain, Type, Protocol0, Extra) when is_map(Extra) -> catch throw:T -> T; + %% <WIN32-TEMPORARY> + error:nosup:S -> + erlang:raise(error, nosup, S); + %% </WIN32-TEMPORARY> error:Reason -> {error, Reason} end. @@ -1088,6 +1092,10 @@ bind(#socket{ref = SockRef}, Addr) inet6 -> nif_bind(SockRef, ?SOCKADDR_IN6_DEFAULT(Addr)) catch + %% <WIN32-TEMPORARY> + error:nosup:S -> + erlang:raise(error, nosup, S); + %% </WIN32-TEMPORARY> throw:ERROR -> ERROR end; @@ -1097,6 +1105,10 @@ bind(#socket{ref = SockRef} = _Socket, Addr) when is_map(Addr) -> nif_bind(SockRef, ensure_sockaddr(Addr)) end catch + %% <WIN32-TEMPORARY> + error:nosup:S -> + erlang:raise(error, nosup, S); + %% </WIN32-TEMPORARY> throw:ERROR -> ERROR end. @@ -1131,6 +1143,10 @@ bind(#socket{ref = SockRef}, Addrs, Action) nif_bind(SockRef, Addrs, Action) end catch + %% <WIN32-TEMPORARY> + error:nosup:S -> + erlang:raise(error, nosup, S); + %% </WIN32-TEMPORARY> throw:ERROR -> ERROR end. @@ -2135,6 +2151,10 @@ shutdown(#socket{ref = SockRef}, How) -> catch throw:T -> T; + %% <WIN32-TEMPORARY> + error:nosup:S -> + erlang:raise(error, nosup, S); + %% </WIN32-TEMPORARY> error:Reason -> {error, Reason} end. @@ -2207,6 +2227,10 @@ setopt(#socket{ref = SockRef}, Level, Key, Value) -> catch throw:T -> T; + %% <WIN32-TEMPORARY> + error:nosup:S -> + erlang:raise(error, nosup, S); + %% </WIN32-TEMPORARY> error:Reason -> {error, Reason} % Process more? end. @@ -2289,6 +2313,10 @@ getopt(#socket{ref = SockRef}, Level, Key) -> catch throw:E:_S -> E; + %% <WIN32-TEMPORARY> + error:nosup:S -> + erlang:raise(error, nosup, S); + %% </WIN32-TEMPORARY> error:Reason:_Stack -> {error, Reason} % Process more? end. |