Skip to content

Commit

Permalink
Drop support for OTP versions before 19
Browse files Browse the repository at this point in the history
  • Loading branch information
lexmag committed Dec 3, 2023
1 parent c23a3bd commit 3e7e3f5
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions lib/statix/packet.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ defmodule Statix.Packet do

use Bitwise

Check warning on line 4 in lib/statix/packet.ex

View workflow job for this annotation

GitHub Actions / Test suite (24, 1.14, true)

use Bitwise is deprecated. import Bitwise instead

Check warning on line 4 in lib/statix/packet.ex

View workflow job for this annotation

GitHub Actions / Test suite (24, 1.14, false)

use Bitwise is deprecated. import Bitwise instead

otp_release = :erlang.system_info(:otp_release)
@addr_family if(otp_release >= '19', do: [1], else: [])

def header({n1, n2, n3, n4}, port) do
true = Code.ensure_loaded?(:gen_udp)

Expand All @@ -16,15 +13,15 @@ defmodule Statix.Packet do
[]
end

@addr_family ++
[
band(bsr(port, 8), 0xFF),
band(port, 0xFF),
band(n1, 0xFF),
band(n2, 0xFF),
band(n3, 0xFF),
band(n4, 0xFF)
] ++ anc_data_part
[
_addr_family = 1,
band(bsr(port, 8), 0xFF),
band(port, 0xFF),
band(n1, 0xFF),
band(n2, 0xFF),
band(n3, 0xFF),
band(n4, 0xFF)
] ++ anc_data_part
end

def build(header, name, key, val, options) do
Expand Down

0 comments on commit 3e7e3f5

Please # to comment.